View Single Post
Old 09-05-2009, 05:25 PM   #3 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

or you can also use the translate function:
php Code:
<?php
$string = 'The quick brown {fox} jumps over the lazy {dog}';
$arr = array("{fox}" => "cat","{dog}" => "mouse");
echo 'before: ' . $string . "\n";
$string = strtr($string, $arr);
echo 'after: ' . $string;
?>
tony is offline  
Reply With Quote