Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在date()函数中使用变量_Php - Fatal编程技术网

Php 如何在date()函数中使用变量

Php 如何在date()函数中使用变量,php,Php,如果下面的代码我想使用变量而不是实际日期 echo date('z', strtotime('13 may ')); 如何使用变量: $month = "may"; $day = "13"; 官方PHP文档中的部分将帮助您 $month = "may"; $day = "13"; echo date('z', strtotime($day . ' ' . $month . ' '));

如果下面的代码我想使用变量而不是实际日期

echo date('z', strtotime('13  may '));
如何使用变量:

$month = "may";
$day = "13";
官方PHP文档中的部分将帮助您

$month = "may";
$day = "13";

echo date('z', strtotime($day . '  ' . $month . ' '));