prefix Posted April 14, 2006 Share Posted April 14, 2006 What I'm trying to do is add an '*' to the end of a single word search string, if an asterixes isn't already there.I've been trying with if (strstr($searchstring,'*'))but can't seem to get it to work.Any help much appreciated. Link to comment https://forums.phpfreaks.com/topic/7395-solved-add-an-to-all-single-word-search/ Share on other sites More sharing options...
KrisNz Posted April 14, 2006 Share Posted April 14, 2006 [!--quoteo(post=364744:date=Apr 14 2006, 08:26 PM:name=prefix)--][div class=\'quotetop\']QUOTE(prefix @ Apr 14 2006, 08:26 PM) [snapback]364744[/snapback][/div][div class=\'quotemain\'][!--quotec--]What I'm trying to do is add an '*' to the end of a single word search string, if an asterixes isn't already there.I've been trying with if (strstr($searchstring,'*'))but can't seem to get it to work.Any help much appreciated.[/quote]I think you want if (!strstr($searchstring,'*')) $searchstring .= "*"; The '!' means not Link to comment https://forums.phpfreaks.com/topic/7395-solved-add-an-to-all-single-word-search/#findComment-26930 Share on other sites More sharing options...
prefix Posted April 14, 2006 Author Share Posted April 14, 2006 [!--quoteo(post=364752:date=Apr 14 2006, 06:14 AM:name=KrisNz)--][div class=\'quotetop\']QUOTE(KrisNz @ Apr 14 2006, 06:14 AM) [snapback]364752[/snapback][/div][div class=\'quotemain\'][!--quotec--]I think you want if (!strstr($searchstring,'*')) $searchstring .= "*"; The '!' means not[/quote]Thank you! did the trick Link to comment https://forums.phpfreaks.com/topic/7395-solved-add-an-to-all-single-word-search/#findComment-26966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.