preg_replace OR eregi_replace, difference?
Posted: Mon Feb 07, 2011 8:38 am
Hi, I want to know the difference between these two replace functions.
I know that, first two ie preg_replace and eregi_replace/ereg_replace are based on regular expressions.
I've used both two, they both are for same purpose.
Manual says, ereg_replace should be avoided if task can be done using str_replace or preg_replace.
I'm using this to extract BB codes from user comments and translating them into respective HTML identities.
SO what should I use for this purpose, preg_replace or eregi_replace?
Help is appreciated! Thank You.
I know that, first two ie preg_replace and eregi_replace/ereg_replace are based on regular expressions.
I've used both two, they both are for same purpose.
Manual says, ereg_replace should be avoided if task can be done using str_replace or preg_replace.
I'm using this to extract BB codes from user comments and translating them into respective HTML identities.
SO what should I use for this purpose, preg_replace or eregi_replace?
Help is appreciated! Thank You.