NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Bold search terms

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 01-29-2006, 12:42 PM THREAD STARTER               #1 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



Bold search terms


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!
PoorDoggie is offline  
Old 02-02-2006, 08:15 AM   #2 (permalink)
Senior Member
 
netzilla's Avatar
Join Date: Aug 2005
Posts: 1,717
netzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to beholdnetzilla is a splendid one to behold
 



How about this....

When you are echoing out the string do a str_replace that would have worked here also. Same technique differnt function.
netzilla is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Your Website's Spelling and the Search Engines !!! jeet_020 Search Engines 3 01-02-2006 02:42 PM
Promoting Your Site (SEO) Floryn For Sale / Advertising Board 0 01-30-2005 04:31 PM
PPC scripts for sale morpheus666 Scripts For Sale 1 03-20-2004 12:15 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 01:07 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger