note 105490 deleted from function.preg-replace by cmb
| From: | cmb@php.net | Date: | Mon, 21 Nov 2016 19:43:56 +0000 |
| Subject: | note 105490 deleted from function.preg-replace by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207313@lists.php.net to get a copy of this message | ||
Note Submitter: kosalasl at gmail dot com
----
I wrote some useful function to display date format based on date function particular string.
preg_replace function really help me to write this tiny code
<?php
function mysql2formatDate($strn,$outformat='n/j/Y'){
return
preg_replace("/(\d{4})-(\d{2})-(\d{2})/e","Date('$outformat',strtotime('$0'))",$strn);
}
?>