strchr and strrchr
strchr
- This function will find the first occurrence of the string and returns a string which starts from fisrt occurrence of the searched string to end of the string
strrchr
- This function will find the last occurrence of the and returns a string which starts from last occurrence of the searched string to end of the string
For Example
$str = “national”;
echo strrchr($str,”na”);
above echo will print nal.
$str = “national”;
echo strchr($str,”na”);
above echo will print national, because na is in the start fo the string
