Snorkel Posted October 8, 2007 Share Posted October 8, 2007 I need a simple script that checks if the URL includes a specific string of text, and if it does, do something, if it doesn't, do something else. I know this can be accomplished with an if/else function, which I can do, but I don't know how to do the checking the URL part. Link to comment https://forums.phpfreaks.com/topic/72260-checking-to-see-if-url-includes-something-how-do-i-do-this/ Share on other sites More sharing options...
trq Posted October 8, 2007 Share Posted October 8, 2007 To get a url (file) into a string use file_get_contents, once you have the file in a string you can simply use strpos to see if it contains a certain string. Link to comment https://forums.phpfreaks.com/topic/72260-checking-to-see-if-url-includes-something-how-do-i-do-this/#findComment-364380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.