我正在研究一些代码,它将一个月变为其数字.
$postdate = "09:24:33 Mar 07, 2014 PST";
//SPLIT UP DATE
$hour = substr("$postdate", 0, -23);
$min = substr("$postdate", 3, -20);
$sec = substr("$postdate", 6, -17);
$month = substr("$postdate", 9, -13);
$day = substr("$postdate", 13, -10);
$year = substr("$postdate", 17, -4);
//SET MONTH TO NUMBER
if($month = "Jan") {$month = 01;}
if($month = "Feb") {$month = 02;}
if($month = "Mar") {$month = 03;}
if($month = "Apr") {$month = 04;}
if($month = "May") {$month = 05;}
if($month = "Jun") {$month = …Run Code Online (Sandbox Code Playgroud)