I have to send an array via curl in this format:
["items"=>[[ "key1" => "value1"],[ "key2" => "value2"]]]
at the moment I will write this structe manualy.
But how can I get this structe from an array?
$myArray = array( "items" => array ( "key1" => "value1", "key2" => "value2"));
2
Answers
This array
coded using the
array()
method would beA var_export with the short array notation is searched for. I am using a function from https://gist.github.com/Bogdaan/ffa287f77568fcbb4cffa0082e954022