I have a variable $newExtract[$x][3]
. When I try to explode it as:
explode("/", $newExtract[$x][3])
It gives me error message:
"Notice: Undefined offset: 3 in C:\xampp\htdocs\torrent\classes\sm9.class.php on line 63".
But, when I echo it using echo $newExtract[$x][3]; die();
, it gives me the result as 13/08/2012 20:58
.
Can anyone help me what is happening? Why, I am not able to explode it?
Thanks
I've seen several places in PHP where implicit string conversion (or string dereferencing, in this case) causes issues and the simplest path to sanity is using an intermediate variable:
$date = $newExtract[$x][3];
explode("/", $date);
It seems to show up more often with certain internal functions, and I usually run into it more with objects and __toString(), but this wouldn't be the first time for this situation, either.