RE: [PHP] ereg() HELP!!!

From: Date: Wed, 08 Nov 2000 01:25:33 +0000
Subject: RE: [PHP] ereg() HELP!!!
Groups: php.general 
Request: Send a blank email to php-general+get-24233@lists.php.net to get a copy of this message
Reg Exp must be one of the more obscure parts that seems to crop up here every day in some form. I guess the strange syntax scares a lot of people away at first, ok something like $text_message = preg_replace("/<img[\s]+.*?src=[\'\"]*([^\"\'\s])/i", "<<\\1>>", $page); I use preg_replace just because that's what I know, eregi is basically the same for most things except the replace \\1 is different I think ? Hope this helps, not tested though, Nick http://www.webclient.com.au Use the backdoor. > -----Original Message----- > From: Jesse Binam [mailto:sirbinam@xmission.com] > Sent: Wednesday, 8 November 2000 12:00 > To: php-general@lists.php.net > Subject: [PHP] ereg() HELP!!! > > > Hey all, > > I have been playing with this for going on 5 hours!! ARRRGGG!!! > > I am making a script that takes HTML and makes a text and > HTML version of > the page. I need to replace <img> tags with the src path. > For example <img > src="http://www.domain.com/images/pic.jpg"> would be > replaced with > <<http://www.domain.com/images/pic.jpg>> > But it has to be flexible enough to allow the user to put in > width, height, > border, or whatever other parameters they want. > This is the code that I have > > while(ereg("SOMETHING!!", $page, $match)) > { > $text_message = eregi_replace($match[0], > "<<$match[1]>>", $page); > } > > Please someone spare me!! > > Thanks, > Jess > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > >

« previous php.general (#24233) next »