Fastest commands
| From: | Shawn McKenzie | Date: | Fri, 25 Apr 2003 17:30:51 +0000 |
| Subject: | Fastest commands | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-145300@lists.php.net to get a copy of this message | ||
Is there a list of commands or any guidance on what executes the fastest?
There are some notes in some of the ereg_, preg_ and str_ function docs
about which ones are faster, but what about others? Also, I want to do a
replace where the search is array indices and the replace is the values of
the found index. Is the following the fastest???
$content = "one, two, three";
$thearray = array (
'one' => '1',
'two' => '2',
'three' => '3',
);
foreach($thearray as $search => $replace) {
$content = str_replace($search, $replace, $content);
}
Thanks!
Shawn