I have a simple form with 2 fields and I want to read the data from it and use it with $_POST.
This is the output when I debug the $_POST function:
file_put_contents( 'debug' . time() . '.log', var_export( $_POST, true));
OUTPUT:
array (
'form' =>
array (
'id' => '36e3113',
'name' => 'New Form',
),
'fields' =>
array (
0 =>
array (
'id' => '0',
'type' => 'text',
'title' => 'Your name',
'value' => 'John',
'raw_value' => 'John',
'required' => '1',
),
1 =>
array (
'id' => '1',
'type' => 'tel',
'title' => 'Phone number',
'value' => '12345',
'raw_value' => '12345',
'required' => '1',
),
),
)
I want to use $POST to only assign values of Your name to $name and Phone number to $number variable.
$fields = array_column($_POST["fields"], "value", "title");