I have an API that I need to write to that expects
$foo = array(
'tags[]' => array('one','two','three','four')
);
My array looks like this
Array
(
[0] => one
[1] => two
[2] => three
[3] => four
[4] => five
[5] => six
)
I've tried adding the array
$foo = array(
'tags[]' => array($arr)
);
But this prints 'Array' once in the database. How do I add the values from $arr to the tags[]?
'aftertags[]?Array, then you are converting your array to a string. You can't store an array in a database, only strings. Maybe you want tojson_encode($arr)?array($arr)that you pass, which then gets inserted.