Following this post I have created this html inside a form:
...
<input type="text" name="setValues[cardExpiration]" id="card_expiry" class="input-small" value="1222">
<input type="text" name="setValues[ipAddress]" id="ip" value="24.37.246.194">
...
After the form is submitted, inside the $_POST
array I see this multi dimensional array as expected:
When I try to retrieve the value, something is happening:
$email = (isset($_POST["setValues"])?$_POST["setValues"]["email"]:FALSE);//Gives NULL
$email = (isset($_POST["setValues"])?$_POST["setValues"]["'email'"]:FALSE);//Gives the email filled in the form.
The point here is the ' key ' single quotes in the array key. It is being part of the key.
This is why $_POST["setValues"]["'email'"]
works and $_POST["setValues"]["email"]
don't.
So what should I do to get the array without quotes inside the key? How to properly setup it inside the input attribute?
This is the var_dump():
echo '<pre>';
var_dump($_POST);
echo '</pre>';