strchr and strrchr

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

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.