AV1611 Posted May 3, 2007 Share Posted May 3, 2007 I need an IF statement that does this: If the variable $string contains this exact string: "<title>Server Offline / Not available" then {this} else {that} if ($string==$match){ this} else{ that} I don't know how to make $match which would be a substring of a larger text string... I know it involves regex prolly but I totally suck at regex Link to comment https://forums.phpfreaks.com/topic/49846-solved-search-for-string/ Share on other sites More sharing options...
utexas_pjm Posted May 3, 2007 Share Posted May 3, 2007 When looking for static strings regex is slow compared to simple string matching, use this: http://us2.php.net/manual/en/function.strpos.php. Best, Patrick Link to comment https://forums.phpfreaks.com/topic/49846-solved-search-for-string/#findComment-244534 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.