Php 从用户给定的日期和时间计算时间戳

Php 从用户给定的日期和时间计算时间戳,php,Php,在我的应用程序中,用户提供两个输入-一个是日期,另一个是时间: $date = date("d-M-Y"); $time=date("h:m:s"); 在PHP中,如何从这两个变量计算时间戳? 事实上,我采用的是日期选择器和time from time oicker的日期格式。…您想要什么格式? If you want time stamp then use this echo strtotime($date.' '.$time);

在我的应用程序中,用户提供两个输入-一个是
日期
,另一个是
时间

$date = date("d-M-Y");
$time=date("h:m:s");
在PHP中,如何从这两个变量计算时间戳?
事实上,我采用的是日期选择器和time from time oicker的日期格式。…

您想要什么格式?
If you want time stamp then use this

echo strtotime($date.' '.$time);