Jump to content

*SOLVED* add an * to all single word search


prefix

Recommended Posts

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
Share on other sites

[!--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
Share on other sites

[!--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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.