我已经回复了一个日期,但它没有正确的格式,我是YMD我已经在我的变量上指定了格式但是当我在变量上调用变量作为我的输入类型的值时它没有给出正确的格式。希望有人帮助我。这是我的代码
<?php
$last_covered=strtotime("+3 Months"); date("Y-m-d", $last_covered);
if ($statusv=='Newly-Registered') echo "<input type='text' class='form-control' name='last_covered' value ='".$last_covered."'>";
你可以试试这个
<?php
$last_covered = date("Y-m-d", strtotime("+3 Months"));
if (!empty($statusv) && ($statusv=='Newly-Registered')) {
echo "<input type='text' class='form-control' name='last_covered' value ='".$last_covered."'>";
} else {}
?>
你在echo线上有未定义的变量可能会将变量$ last_covred修复为$ last_covered