Hi there, I have a date format like this :
$date1 = "Sun May 09 20:07:50 +0000 2010";
and I have to convert it to: 09-05-2010
I am echoing it with echo date("d-m-Y", strtotime($date1));
When I print this individually it gives proper result but I am using it in loop it gives me results like: 31-12-1969
The loop i am using is :
foreach($userinfo as $k=>$v)
{
if($k == 'test')
{
foreach($v as $k1=>$v1)
{
echo $v1."<br>";
//echo strtotime($v1)."<br>";
//echo $date = date("d-m-Y", strtotime($v1));
}
}
}
Guys when I echo $v1 it gives me:Sun May 09 20:07:50 +0000 2010 Also when I echo strtotime($v1); it gives blank. However funny thing is I am getting this conversion perfectly in 1D loop.
Can you help, please?