Bold search terms

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
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.
GoDaddyGoDaddy
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
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back