You can use strpos to get the first position " from position 20 on the page:
$pos = strpos($str, '"', 20);
Then this position can be used to get the substring:
if ($pos !== false) { // " found after position 20 $substr = substr($str, 20, $pos-20-1); }
A calculation for the third parameter is necessary because substr expects the length of the substring, not the end position. Also note that substr returns false if the needle cannot be found in the haystack.
Gumbo
source share