I was bug squashing my script when I discovered that an array ($array
) contained two arrays with no key like so:
array(19) {
["id"]=>
string(3) "243"
["var"]=>
string(4) "test"
}
array(10) {
["id"]=>
int(243)
}
They both contain different data, i just removed most of it to show what I'm talking about. Now I will find the cause of this eventually and fix it, but what I need is a temporary fix to get the value of var
from the first array. Currently when I use print_r and var_dump I do get the actual value of var
but also a NULL
. For that reason I can't seem to store the value of var
in a variable.
Any ideas?
Here is the full array (with some sensitive data masked)
Array
(
[id] => 243
[ordering] => 0
[state] => 1
[checked_out] => 203
[checked_out_time] => 2013-07-17 14:28:15
[status] => new
[order_id] => 84
[username] => 267
[ankleside] => left
[engraving] => left
[serial] => 152
[color_padding] => left
[color_shell] => left
[scan] => SCAN_2013-07-17_xxxxxx_X_hotmail.com_LEFT.PNG
[workfile] => WORK_2013-07-17_xxxxxx_X_hotmail.com_LEFT.png
[stlfile] => 2013-07-17_xxxxxx_X_hotmail.com_LEFT_.jpg
[timespent] =>
[created_by] => 203
)
Array
(
[id] => 243
[status] => new
[username] => 267
[ankleside] => left
[engraving] => left
[scan] => SCAN_2013-07-17_xxxxxxx_X_hotmail.com_LEFT.PNG
[workfile] =>
[stlfile] => fb-foto.png
[issues] =>
)