How to Find Next String After the Needle Using Strpos()
I'm using PHP strpos() to find a needle in a paragraph of text. I'm struggling with how to find the next word after the needle is found. For example, consider the following paragraph. $description = "Hello, this is a test paragraph. The SCREENSHOT mysite.com/screenshot.jpg and the LINK mysite.com/link.html is what I want to return."; I can use strpos($description, "SCREENSHOT") to detect if SCREENSHOT exists, but I want to get the link after SCREENSHOT, namely mysite.com/screenshot.jpg . In a similar fashion, I want to detect if the description contains LINK and then return mysite.com/link