I feel like I am going crazy. I have submitted the following POST request containing these inputs:
...
<textarea type='text' name='description["add"]></textarea>
<textarea type='text' name='description["modify"]></textarea>
<textarea type='text' name='description["delete"]></textarea>
...
When I print them out using print_f($_POST)
, this is the output:
[description] => Array
(
["add"] => blah blah blah
["modify"] => bleh bleh bleh
["delete"] => bloh bloh bloh
)
I want to access the text in ["add"]
. I try print_r($_POST['description']['add']
but it keeps returning nothing!
How can I access the deeper levels of the $_POST array? Everything I thought I knew about php is wrong!
I have tried other formats like $_POST['description']->add
and $_POST['description'][0]
. Both return nothing.
The only way I thing that I found works is iterating using a foreach.
foreach ($_POST['description' as $value) {
print_r($value);
}
What am I missing? Please help!! I'm going insane. Thank you