ok this is the code:
for($i=0;$i<25;$i++)
{
$dates=array();
$date="24-01-2010-0$i:00";
preg_replace("/([0-3][0-9])\-([0-1][0-9])\-(20[0-9][0-9])\-([0-2][0-9])\:([0-6][0-9])/e",'$dates=array($1,$2,$3,(int)$4,(int)$5)',$date);
echo"<br>\$i=$i: $date >> ";
print_r($dates);
}
and this is the output:
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=0: 24-01-2010-00:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 0 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=1: 24-01-2010-01:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 1 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=2: 24-01-2010-02:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 2 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=3: 24-01-2010-03:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 3 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=4: 24-01-2010-04:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 4 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=5: 24-01-2010-05:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 5 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=6: 24-01-2010-06:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 6 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=7: 24-01-2010-07:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 7 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=8: 24-01-2010-08:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 0 [4] => 0 )
Notice: Array to string conversion in D:\Files\MyDocs\Webdesign\test.php on line 10
$i=9: 24-01-2010-09:00 >> Array ( [0] => 24 [1] => 1 [2] => 2010 [3] => 0 [4] => 0 )
$i=10: 24-01-2010-010:00 >> Array ( )
$i=11: 24-01-2010-011:00 >> Array ( )
$i=12: 24-01-2010-012:00 >> Array ( )
$i=13: 24-01-2010-013:00 >> Array ( )
$i=14: 24-01-2010-014:00 >> Array ( )
$i=15: 24-01-2010-015:00 >> Array ( )
$i=16: 24-01-2010-016:00 >> Array ( )
$i=17: 24-01-2010-017:00 >> Array ( )
$i=18: 24-01-2010-018:00 >> Array ( )
$i=19: 24-01-2010-019:00 >> Array ( )
$i=20: 24-01-2010-020:00 >> Array ( )
$i=21: 24-01-2010-021:00 >> Array ( )
$i=22: 24-01-2010-022:00 >> Array ( )
$i=23: 24-01-2010-023:00 >> Array ( )
$i=24: 24-01-2010-024:00 >> Array ( )
The thing that doesnt fit here why doest the array contain the 9 and 8 while the 0-7 do get in the array?
Nad the other thing I dont get is why I get the error :S
I think that one, I dont understand (wich would be likely) regex or two that this is a bug in php
any thoughts of anyone?