I have a code to find a position of a specfic string. here is the code.
<?
$string1 = "she is a girl, he is a boy";
$string2 = "she is a girl, (he) is a boy";
$string3 = "she is a girl, \"he\" is a boy";
echo strpos($string1,"he");
?>
for $string1, i wanna find the position of "he", the strpos will return 1. which is the "he" inside "she", but what i want is the "he" after the word "girl".
how can i solve this problem??
Besides, for $string2 and $string3, although "he" is embraced a '()' and '""',
i want the strpos still can return a correct answer, how can i do so??
can i use regular expression in strpos??
Thank you very much.