Need help understanding code
Posted: Fri Feb 26, 2010 5:17 pm
I am new to php but I have lots of VB.NET experience. The block of php code below is resulting in
"$today) { ?> Registration......" without the quotes. Why is the comparison operator '>' being treated like '?> ' ??
<?php
$beg_date = "2010-03-01";
$exp_date = "2010-04-16";
$todays_date = date("Y-m-d");
$today = strtotime($todays_date);
$beginning_date = strtotime($beg_date);
$expiration_date = strtotime($exp_date);
if ($beginning_date > $today){
?>
Registration has not opened.<br>Please come back and register between March 1st and April 16th.<br>
<?php
}
?>
"$today) { ?> Registration......" without the quotes. Why is the comparison operator '>' being treated like '?> ' ??
<?php
$beg_date = "2010-03-01";
$exp_date = "2010-04-16";
$todays_date = date("Y-m-d");
$today = strtotime($todays_date);
$beginning_date = strtotime($beg_date);
$expiration_date = strtotime($exp_date);
if ($beginning_date > $today){
?>
Registration has not opened.<br>Please come back and register between March 1st and April 16th.<br>
<?php
}
?>