note 63479 added to function.preg-replace
| From: | leonardomachado at email dot com | Date: | Wed, 22 Mar 2006 19:50:00 +0000 |
| Subject: | note 63479 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106337@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 200.185.109.103
Probable Submitter: 200.202.193.1 (proxied: 1.1 Clearswift Web Policy Engine)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- http://master.php.net/note/edit/63479
Del: integrated -- http://master.php.net/note/delete/63479/integrated
Del: useless -- http://master.php.net/note/delete/63479/useless
Del: bad code -- http://master.php.net/note/delete/63479/bad+code
Del: spam -- http://master.php.net/note/delete/63479/spam
Del: non-english -- http://master.php.net/note/delete/63479/non-english
Del: in docs -- http://master.php.net/note/delete/63479/in+docs
Del: other reasons-- http://master.php.net/note/delete/63479
Reject -- http://master.php.net/note/reject/63479
Search -- http://master.php.net/manage/user-notes.php