I have to build an array as the following one gathering values from $_POST superglobal. ca_objets value would be gather from a variable and the part after the dot is what I need to gather from $_POST.
$va_body=array(
"bundles" => array(
"ca_objects.description" => array("convertCodesToDisplayText" => true),
"ca_objects.description" => array("convertCodesToDisplayText" => true),
"ca_object.representations.caption" => array("convertCodesToDisplayText" => true)
)
);
This is the code I use:
<?php
$table="ca_objects";
$bund=$_POST['find_bundles']; //This is an array with the values I need.
$va_body=array("bundles" => array()); //I declare the array outside the foreach loop.
I'm not sure how to code the loop in order to populate the "bundles" array inside $va_body array and get the result I need. Any help will be greatly appreciated.
foreach ($bund as $elem ) {
// code here
}
?>