i need help in regular expression

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
altamash
Forum Newbie
Posts: 8
Joined: Mon Jul 21, 2003 6:03 am

i need help in regular expression

Post by altamash »

I have a db with the fields having all the HTML of the page
I wana search a word from the HTML field of db and I wana show the results so that only the peragraph having the Searched word will display.
I m using regular expression
My code is
eregi("<p>.*$Search*.</p>",$String,$NString);
print "<br>\$NString[0] :: $NString[0]<br>";
here $Search is the varible containing the word to be searched
$String is the whole row from the HTML field of db
$NString is the array which will store the resultnet array
but the $NString[0] doesn't print any value
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

first, there's a php tag. might help.


second, there's some funky thing i can never remember that one has to do to insert an array... make it a variable insert that (it's easier)


3rd, why eregi? perl is so much nicer
Post Reply