Hi All. After smashing my head on the edge of the desk for a day or two I’ve finally admitted defeat and decided to ask for help.
I have the following array (part of a larger array) which is identified as: $spaces[“Row[$key]”] - $key being “3” in this example.
[Row[3]] => Array ( [0] => 26 [1] => 31 [2] => 32 [3] => 34 [4] => 36 [5] => 40 [6] => 44 [7] => 50 [8] => 52 [9] => 54 [10] => 58 [11] => 60 [12] => 62 [13] => 63 )
out of which I’m using a loop part of which is to extract the following data:
$last = end($spaces[“Row[$key]”]);
$squares = $last;
list($first) = $spaces[“Row[$key]”];
$Position = $first;
all that works fine and dandy however when I use the following:
$Dump = array_shift($spaces[“Row[$key]”]);
in an if subloop to drop the 26 from the beginning giving me
[Row[3]] => Array ( [0] => 31 [1] => 32 [2] => 34 [3] => 36 [4] => 40 [5] => 44 [6] => 50 [7] => 52 [8] => 54 [9] => 58 [10] => 60 [11] => 62 [12] => 63 )
and then the:
$last = end($spaces[“Row[$key]”]); * In this case 63 which is working and correct
$squares = $last;
list($first) = $spaces[“Row[$key]”];
$Position = $first;
again, which works in the loops before, the list() instruction throws a “PHP Notice: Undefined offset: 0” warning despite there clearly being something in the array row $key = 3
Frankly, I’m baffled. I understand, roughly what the warning means however I’m pretty sure there’s a value where the code is being instructed to look. I’ve tried a reset() just in case the keys were out of whack, but it made no difference.
Any help, advice, suggestions would be v much appreciated…