I am attempting to store the date in a variable using getdate(). What am I doing wrong?
$today = getdate();
echo "the date today is ".$today;
Output: the date today is Array
I am attempting to store the date in a variable using getdate(). What am I doing wrong?
$today = getdate();
echo "the date today is ".$today;
Output: the date today is Array
getdate() returns an array so you might want to do something like
echo 'The date today is '. $today['year'].'-'.$today['mon'].'-'.$today['mday'];
I would prefer using date():
echo 'The date today is '. date('Y-m-d');