note 63479 rejected from function.preg-replace by nlopess
| From: | nlopess@php.net | Date: | Wed, 22 Mar 2006 20:14:34 +0000 |
| Subject: | note 63479 rejected from function.preg-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106344@lists.php.net to get a copy of this message | ||
Note Submitter: leonardomachado at email dot com
----
I need to convert timestamp in a string to date.
I tried:
$string="blah blah 1136419200 blah blah 1038873600 blah blah";
$string = preg_replace("/(1[0-9]\d{8})/",date('d/m/y h:m:s',$1),$string1);
But did not work because $1 is not expanded before the function call.