2
I am making adaptations in an old system and need to create a new routine to split a two-dimensional array into 2 simple arrays.
Let’s say the variable $query
get the array below:
$query = array("SELECT * FROM teste WHERE nome in (?) and id in (?)", array('aaa', 1));
My goal is to split this array and make a variable $sql
receive:
SELECT * FROM teste WHERE nome in (?) and id in (?)
And another, called $arg
, receive:
array('aaa', 1)
I’ve tried this division with implode
, but the return was not what was expected.
And with explode
always get NULL
.
Is there a native PHP function that does this division? Or at least some routine that can do it through brute force?
Thanks in advance.
That’s exactly what I needed, thank you!
– Lucas Padilha