dennismonsewicz Posted April 8, 2009 Share Posted April 8, 2009 How would I go about searching through a URL to look for a particular word? Link to comment https://forums.phpfreaks.com/topic/153190-searching-a-url/ Share on other sites More sharing options...
thebadbad Posted April 8, 2009 Share Posted April 8, 2009 If you simply want to check if one string appears inside another, use strpos(): <?php $url = 'http://google.com'; $word = 'goog'; if (strpos($url, $word) !== false) { //word was found } else { //word wasn't found } ?> Link to comment https://forums.phpfreaks.com/topic/153190-searching-a-url/#findComment-804708 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.