Knowledgebase
php preg vs ereg?
Posted by WebCobra, 02-11-2010, 07:55 PM | Hi im curious. What is the difference with preg and ereg?
and then i find in the php manual that ereg and eregi are bad. In the future, would ereg won't exist?
http://i46.tinypic.com/2415jld.png
-thanks.
|
Posted by csparks, 02-11-2010, 10:54 PM | ereg(i) is more resource intensive somehow, but I dont know why that is. Plus its depreciated, so using it would cause your scripts to become broken in the future (just depreciated as of 5.3.0 it looks like, so it will be the the not so distant future that it will no longer work at all).
|
Posted by larwilliams, 02-12-2010, 01:32 AM | Yea, apparently all the ereg* functions are going away in PHP6.
|
Posted by TonyB, 02-12-2010, 03:18 AM | preg is the Perl Ccmpatible regex library
ereg is the POSIX compliant regex library
The preg functions are often faster and you can do much more complex things with them. So I wouldn't waste your time with ereg at this point since it's deprecated and is being removed from PHP.
|
Posted by bilalamjad3, 02-13-2010, 01:02 AM | preg is the Perl Ccmpatible regex library
ereg is the POSIX compliant regex library
there are huge difference between the two.
|
|
Add to Favourites
Print this Article |
Also Read