I've encoded an Array I've made using the inbuilt json_encode();
function. I need it in the format of an Array of Arrays like so:
[["Afghanistan",32,12],["Albania",32,12]]
However, it is returning as:
["2":["Afghanistan",32,12],"4":["Albania",32,12]]
How can I remove these row numbers without using any Regex trickery?
["2":["Afghanistan",32,12],"4":["Albania",32,12]]
is not even valid JSON, so I doubt you get that. If your top level array is associative just callarray_values()
to get consecutive indexed elements. – Felix Kling Jul 30 '12 at 12:59