highlighting search terms


Posted on 16th Feb 2014 07:03 pm by admin

well, I started this in the regular PHP section, but it no longer fits there. Suffice it to say, I'm trying to take individual search terms that are being $_POSTed and highlighting them in the search results.

The Original Post talked about using str_replace to handle this. New problem, though, when the same search terms show up inside a HTML tag (like <img src="search_term">).

Did you know?Explore Trending and Topic pages for more stories like this.
I'm trying "/b(?!<.+?>)search_termb/" -- but it's still finding "search_term" inside <img src="search_term">.
No comments posted yet

Your Answer:

Login to answer
69 Like 30 Dislike
Previous forums Next forums
Other forums

Basic Question about Threading and PHP...
I have a page that I am working on and it is taking several hours to process. The basics of what th

if statements problems
Hi. I'm trying to make a web form, but I kind of hit a dead end trying to figure out why it doesn't

Retreiving objects from Sessions
Hi all,

I am getting really frustrated with storing and retreiving objects from a session. Bu

returning data from an ssh2_exec()
here's what i got.


$conn = ssh2_connect($this->_host);
ssh2_auth_password($c

Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don'

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

PHP Function Page Advice
Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and edu

Images outside webroot
Im hopeing someone can help me with this because i cant figure it out.I have setup an ASP.NET websit

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

Create or replace package is ending ORA-21700
Database 9.2.0., patch 8 (9.2.0.8.0).
I trying run
create or replace package ....etc.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash