It finds the position of the first occurrence of a substring in a string
Example
<?php
echo strpos(“phpcode”,”co”);
?>
Output
3
It finds the position of the first occurrence of a substring in a string
Example
<?php
echo strpos(“phpcode”,”co”);
?>
Output
3
It searches a string for any of the specified characters.
Example
<?php
echo strpbrk(“phpcode”,”co”);
?>
Output
code
It compares first n characters (case-sensitive) of a strings
Example
<?php
echo strncmp(“phpcode”,”codez”,7);
?>
Output
1
It compares two strings
Example
<?php
echo strncasecmp(“phpcode”,”codez”,7);
?>
Output
13