小编Chr*_*ill的帖子

多个IF语句不起作用?

我正在研究一些代码,它将一个月变为其数字.

$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)

php if-statement

1
推荐指数
1
解决办法
67
查看次数

标签 统计

if-statement ×1

php ×1