Date and time converted into a digital string
Example: 2007-01-12 19:15:58
Converted into 20070112191558
How can it be turned into this
------Solution--------------------
$s = ' 2007-01-12 19:15:58 ';
echo Date ("Ymdhis", Strtotime ($s));
------Solution--------------------
Time zone setting, first line plus: Date_default_timezone_set (' PRC ');
------Solution--------------------
Date_default_timezone_set (' PRC ');//Set time zone for China
------Solution--------------------
Select Now () +0
------Solution--------------------
$t =str_replace "-", "", $t);
$t =str_replace "", "", $t);
$t =str_replace ":", "" ", $t);
------Solution--------------------
Wuhan Guest Information Technology Co., Ltd. How to: http://topic.csdn.net/u/20120815/21/ee72e021-2db7-4012-9f67-8f77353351bf.html
------Solution--------------------
Date_default_timezone_set (' PRC ');
$s = ' 2007-01-12 19:15:58 ';
echo Date (' Ymdhis ', strtotime ($s));
------Solution--------------------
$s = ' 2007-01-12 19:15:58 ';
Preg_match_all ('/(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/', $s, $mat);
$res = "";
for ($i =1; $i
<>
$res. = Join ("', $mat [$i]);
}
echo $res;//20070112191558