dambuster
04-15-2012, 10:37 PM
Hi Folks,
I have an array of date variables $Gv_end_date[]
I would like to extract the year into a separate variable but have hit a brick wall and am doing something quite wrong and no doubt stupid. I've put in a couple of echos with an exit and the output looks like the following. Any help pleasssse
$endyear = date(Y,$Gv_end_date[$i]);
echo $Gv_end_date[$i]; // displays 2015-07-22 (this is expected)
echo $endyear; // displays 1970
I have an array of date variables $Gv_end_date[]
I would like to extract the year into a separate variable but have hit a brick wall and am doing something quite wrong and no doubt stupid. I've put in a couple of echos with an exit and the output looks like the following. Any help pleasssse
$endyear = date(Y,$Gv_end_date[$i]);
echo $Gv_end_date[$i]; // displays 2015-07-22 (this is expected)
echo $endyear; // displays 1970