PHP:strotime的问题
所以我想让一些代码在网络研讨会结束后一小时出现在页面上。我写了这段代码:PHP:strotime的问题,php,wordpress,Php,Wordpress,所以我想让一些代码在网络研讨会结束后一小时出现在页面上。我写了这段代码: <section id="webinar-details"> <?php $webinar_date = types_render_field("start-date", array( "raw" => "true")); $webinar_end_date = $webinar
<section id="webinar-details">
<?php
$webinar_date = types_render_field("start-date", array( "raw" => "true"));
$webinar_end_date = $webinar_date + ('1 hour');
$lp_url = types_render_field("landing-page-url", array("raw" => "true","show_name" => "false" ));
if($webinar_end_date < time()){
$btn_text = webinar_cta_link_text($lp_url);
}else{
$btn_text = 'Register Now';
}
?>
<time id="webinar-start" itemprop="startDate" datetime="<?php echo date("c",$webinar_date); ?>"><?php echo date("M j, Y g:i a",$webinar_date); ?> ET</time>
<time class="hide" itemprop="endDate" datetime="<?php echo date("c",$webinar_end_date); ?>"><?php echo date("M j, Y g:i a",$webinar_end_date); ?> ET</time>
​<meta itemprop="location" content="Online" />
<meta itemprop="duration" content="PT1H" />
<?php
if(!empty($lp_url)){
?>
<a itemprop="url" class="bob blue-bob" href="<?php echo $lp_url;?>" target="_blank"><?php echo $btn_text;?></a>
<?php
}
?>
<br />
<br />
<?php
if(strtotime($webinar_end_date) > strtotime($webinar_date)){
?>
<div id="spotlight-markup-1">
<h3>Get Started</h3>
<p>Don't know where to start? No worries. Your sales enablement journey starts here.</p>
</div>
</section>
<?php
}
?>
<?php
var\u dump(strotime($webinar\u end\u date),strotime($webinar\u date))
在哪里添加代码?它会取代已经存在的东西吗?它只是调试代码——放在if语句之上。你需要仔细检查这些值是什么——很可能它们不是你所期望的。