So here is my array:
array(1) { [0]=> string(79) "{"form_array":{"element1":"value1","element2":"value2","element3":"value3"}}" }
How can I extract "form_array" as an array?
So here is my array:
array(1) { [0]=> string(79) "{"form_array":{"element1":"value1","element2":"value2","element3":"value3"}}" }
How can I extract "form_array" as an array?
You actually have just a simple array with one element, which is a string, that seems to be JSON encoded. To get its data, you may use the following:
// get the string
$data = $array[0];
// decode the content
$data = json_decode( $data, true );
// get the sub array
$data = $data['form_array'];
The steps may of course be simplified into a single row. I just separated them for readability and clarity.