2016年7月25日 星期一

[PHP] Function strstr(),strchr()

Function strstr()

Find the first word and return the rest of the string:

Example:

<?php
 echo strstr("I love my family.","my");?>


Result:

my family.




Function strchr()


Find the first occurrence of "o" inside "I love my family." and return the rest of the string:

Example:

<?php
 echo strstr("I love my family.","o");?>

Result:


ove my family.

沒有留言:

張貼留言