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. Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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.