NameSilo

Bold search terms

Spaceship Spaceship
Watch

PoorDoggie

Soon to be RICHdoggie!VIP Member
Impact
18
When you search in a search engine, your search terms go bold...

I want every word in a string to be found in another string and turn bold.

$q is the query from a user (eg: football results)
$result[1][snippet] is the snippet of test associated with the first result (eg: The best type football is where the results are good.)

I want to output "The best type of football is where the results are good."

How can I do this?

Thanks
Tom

Done... thanks... -

I exploded the $q variable by " " (a space) and then did an eregi_replace on the snippet!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
How about this....

When you are echoing out the string do a str_replace that would have worked here also. Same technique differnt function.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back