php-db | 2001071
Date: 07/09/01
- Next message: Adv. Systems Design: "[PHP-DB] image resizing"
- Previous message: Johannes Janson: "[PHP-DB] Re: Stupid question"
- In reply to: nloboek <email protected>: "[PHP-DB] Re: ereg_replace"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> >What I'm doing is using ereg_replace in this form:
> >$LargeString = ereg_replace("<tag>.*</tag>",
> >"replacement", "$LargeString");
> >but what I get is the string with the replacement in a
> >way I don't actually want. It replaces the part of the
> >string that begins with THE FIRST TAG <tag> and that
> >ends with THE LAST TAG </tag>.
Use preg_raplace and make it "ungreddy" using "?" :
$LargeString = preg_replace("|<tag>.*?</tag>|","replacement",
$LargeString);
Regards,
Soeren
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Adv. Systems Design: "[PHP-DB] image resizing"
- Previous message: Johannes Janson: "[PHP-DB] Re: Stupid question"
- In reply to: nloboek <email protected>: "[PHP-DB] Re: ereg_replace"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

