📜  php 脚本生成随机日期 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:19.735000             🧑  作者: Mango

代码示例1
//Generate a timestamp using mt_rand.
$timestamp = mt_rand(1, time());

//Format that timestamp into a readable date string.
$randomDate = date("d M Y", $timestamp);

//Print it out.
echo $randomDate;