shakyj — 2010-10-20T18:04:34-04:00 — #1
I have a an array that looks like this
array0( array1("values0"), array2("values1"))
What I can't figure out is how I get the values from array2 in a new array or a foreach loop.
It's probably quite obvious and I am just being slow today... :lol:
shakyj — 2010-10-20T18:51:16-04:00 — #2
Found it. Completely obvious.
$newarray = array_values($array0);
shakyj — 2010-10-20T18:45:14-04:00 — #3
Ok, I tried that. After the first foreach loop $sub contains the keys and values of array1() but I want array2().
How do I get that one?
scallioxtx — 2010-10-20T18:13:15-04:00 — #4
Or, as a general function:
foreach($array as $value)
shakyj — 2010-10-20T18:19:07-04:00 — #5
Thanks loads to both of you.
It's been a long day... :lol:
wonshikee — 2010-10-20T18:07:34-04:00 — #6
foreach ($array0 as $sub)
foreach ($sub as $v)
$newarray = $v;