note 17105 added to function.ereg
| From: | danb at saturdaybang dot com | Date: | Mon, 26 Nov 2001 20:08:26 +0000 |
| Subject: | note 17105 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21291@lists.php.net to get a copy of this message | ||
Use preg_match instead of ereg. It is *MUCH* faster. I had a script that was taking 20+ seconds to
run and when I changed it over to preg_match, it went down to pretty much immediately displaying in
my browser.<br>
To convert a POSIX style string to a Perl style one (at least in my experience) just add a delimiter
to the begining and end. Also, add 's' to the end after the delimiter to tell the parser
to treat the entire string as one piece instead of multiple lines. (ie. "foo" is changed
to "|foo|s")
--
http://www.php.net/manual/en/function.ereg.php
http://master.php.net/manage/user-notes.php?action=edit+17105
http://master.php.net/manage/user-notes.php?action=delete+17105
http://master.php.net/manage/user-notes.php?action=reject+17105