note 36426 added to function.strtotime

From: Date: Thu, 09 Oct 2003 07:18:49 +0000
Subject: note 36426 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-58091@lists.php.net to get a copy of this message
<?php function ch_strtotime($d) { $ar = array( array("/½ñÌì|ÏÖÔÚ/","now "), array("/×ò|ÉÏ|È¥/","-1 "), array("/Ã÷|ÏÂ/","+1 "), array("/^ǰ/","-2 "), array("/^ºó/","+2 "), array("/Äê/"," year "), array("/ÔÂ/"," month "), array("/ÖÜ|ÐÇÆÚ/"," week "), array("/Ìì|ÈÕ/"," day"), array("/Сʱ/"," hours "), array("/·Ö/"," minutes "), array("/Ãë/"," seconds "), array("/(.+)ºó/","-\\1"), array("/(.+)ǰ/","-\\1") ); for($i=0;$i<count($ar);$i++) { $patterns[$i] = $ar[$i][0]; $replace[$i] = $ar[$i][1]; } $d = preg_replace($patterns,$replace,$d); echo "<br>",date("Y-m-d H:i:s",strtotime($d)); } // Àý ch_strtotime("ÏÖÔÚ"); ch_strtotime("È¥Äê"); ch_strtotime("1Сʱ3·Ö40Ãë"); ?> ---- Manual Page -- http://www.php.net/manual/en/function.strtotime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+36426 Delete -- http://master.php.net/manage/user-notes.php?action=delete+36426&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+36426&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#58091) next »