I’m searching through text with preg_match_all. I’m searching for “photo.php?ID=”, because I would like to pull that ID parameter out (ID can be alphanumerical).
Example text:
"Here is an article with an <img src="/photo.PHP?ID=pic_14" /> image."
"Or here is an article with a different <img src="http://www.example.com/photo.PHP?ID=14" /> image."
I’ve tried some pretty awful regex I would say:
preg_match_all("/photo\/(.*?)\"/", $text, $matches);
This should work. It assumes your ID is alpha-numerical.