optimaximal Posted February 13, 2007 Share Posted February 13, 2007 In the If statement, is there a simple way to look at a string and find a particular word, much like the SQL LIKE '%%' function, or will I have to do a bit of string comparison? Quote Link to comment https://forums.phpfreaks.com/topic/38288-does-php-have-a-like-function/ Share on other sites More sharing options...
hvle Posted February 13, 2007 Share Posted February 13, 2007 no it doesn't have the 'like' function but there are many string functions that are working just like 'like'. One of them is strstr. Quote Link to comment https://forums.phpfreaks.com/topic/38288-does-php-have-a-like-function/#findComment-183490 Share on other sites More sharing options...
redbullmarky Posted February 13, 2007 Share Posted February 13, 2007 yeah strstr would do the trick to an extent. however, as LIKE is case-insensitive as far as i know, try stristr Quote Link to comment https://forums.phpfreaks.com/topic/38288-does-php-have-a-like-function/#findComment-183494 Share on other sites More sharing options...
hvle Posted February 13, 2007 Share Posted February 13, 2007 yes definitely redbull, good catch. Quote Link to comment https://forums.phpfreaks.com/topic/38288-does-php-have-a-like-function/#findComment-183907 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.