I understand that this function will get the first occurrence of the string.
But what I want is the 2nd occurrence.
How to go about doing that?
Easily, just do it:
$i = $pos = 0; do { $pos = strpos( $string, $needle, $pos+1 ); } while( $i++ < $nth);
$nth for your situation is equal to 2.