note 56131 deleted from function.str-replace by sean
| From: | sean@php.net | Date: | Wed, 24 Aug 2005 15:55:20 +0000 |
| Subject: | note 56131 deleted from function.str-replace by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94135@lists.php.net to get a copy of this message | ||
Note Submitter: araiguma
Reason: useless
----
also a nice way to replace:
$str = 'answer: yes/no?';
$ar = array(
' ' => '_',
':' => '{colon}',
'?' => '{question mark}',
'yes' => 'Y',
'no' => 'N'
);
echo str_replace(array_keys($ar), array_values($ar), $str);
// result: answer{colon}_Y/N{question mark}