note 49186 added to function.ereg
| From: | arnico at c4 dot lv | Date: | Wed, 19 Jan 2005 11:14:48 +0000 |
| Subject: | note 49186 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83617@lists.php.net to get a copy of this message | ||
Sometimes for faster script, better is to use "ereg" not "preg"!
I have tested both functions and result is :
Yes, ereg is slower than preg, but what happens when function did not found any matches?! Then ereg
is fast, but preg is doing something big and is much more slower.
So when writing script you need to check vhere is small posible to found match.
For example in testing user posted data you can use ereg and this will be very fast for user who
posts "good data", but for bad peoples it will be slower :)
P.S. sorry about my bad English
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49186
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49186&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49186&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49186&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49186&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49186&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49186&report=yes
Search -- http://master.php.net/manage/user-notes.php