/ Published in: PHP
Released into the public domain. Example: echo convert_dates('On 1969-07-20, the first Moon landing occurred. The crew returned to Earth on 1969-07-24. The last landing occurred on 1972-12-11.'); prints "On July 20, 1969, the first Moon landing occurred. The crew returned to Earth on July 24, 1969. The last landing occurred on December 11, 1972."
Expand |
Embed | Plain Text
<?php global $months; $months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); function convert_dates($text) { $date_regexp = '/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/'; $dates = $dates[0]; $new_dates = $dates; for($i=0;$i<count($new_dates);$i++) { } return $text; } ?>
You need to login to post a comment.
