didgydont Posted August 26, 2008 Share Posted August 26, 2008 hi all is it possible to do if post contains * do this thank you for your time if($item == "%*%"){ echo "<option value='$uid' selected>$item</option>";} Link to comment https://forums.phpfreaks.com/topic/121327-solved-if-post-contains/ Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 if (strpos($item, '*') !== FALSE) { //do something } Link to comment https://forums.phpfreaks.com/topic/121327-solved-if-post-contains/#findComment-625522 Share on other sites More sharing options...
inactive Posted August 26, 2008 Share Posted August 26, 2008 Is * meant to be a wildcard? They maybe a bit of http://www.php.net/manual/en/function.preg-match.php with some simple regex? Link to comment https://forums.phpfreaks.com/topic/121327-solved-if-post-contains/#findComment-625524 Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 No, he wants to know if it actually contains a *. If he wanted a wildcard, he'd basically need to see if the strlen() was greater than 0... >_> Link to comment https://forums.phpfreaks.com/topic/121327-solved-if-post-contains/#findComment-625528 Share on other sites More sharing options...
didgydont Posted August 26, 2008 Author Share Posted August 26, 2008 thanx guys no * wasnt ment to be wild card the % was just thought that because of the sql querys if (strpos($item, '*') !== FALSE) { //do something } worked perfectly thank you very much Link to comment https://forums.phpfreaks.com/topic/121327-solved-if-post-contains/#findComment-625532 Share on other sites More sharing options...
inactive Posted August 26, 2008 Share Posted August 26, 2008 Coolio. Link to comment https://forums.phpfreaks.com/topic/121327-solved-if-post-contains/#findComment-625540 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.