execution time: preg vs ereg vs explode & implode
| From: | Tim Gallagher | Date: | Wed, 12 Jun 2002 15:26:02 +0000 |
| Subject: | execution time: preg vs ereg vs explode & implode | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-1634@lists.php.net to get a copy of this message | ||
Can anyone tell me if using explode is slower, or faster or nearly the same as using preg.
I understand that preg is faster than ereg, is this true? How much faster?
here's my code, i want to take a file that has {{{ or }}} and explode on both.
should I use preg_split instead? Would it be faster?
$ar = explode("{{{", $fileContents);
$ar = implode(":::", $ar);
$ar = explode("}}}", $ar);
$ar = implode(":::", $ar);
$ar = explode(":::", $ar);
thanks,
-timmyg