Hi,
Having some trouble getting some values from input arrays.
Trying out something simple before scaling it up as I need alot more inputs than this.
<input type="text" name="option[one]"/>
<input type="text" name="option[two]"/>
<input type="text" name="option[three]"/>
<input type="text" name="option[four]"/>
Tried various bits to get any values entered into them fields to display, but nothing. Such as the following:
$yourArray = $_POST['option'];
foreach ($yourArray as $attributes){
echo key($yourArray).' '.$attributes.'<br>';
}
foreach ($_POST['option'] as $key => $value) {
echo "<p>".$key."</p>";
echo "<p>".$value."</p>";
echo "<hr />";
}
var_dump ($_POST['option']); gives me 'null'.
I basically need to grab any input field that has something entered into it. There are other fields in the form that need to be separate from this group of fields, so thinking of using input arrays for the solution. But, I cant get the simplest of things to work before checking if the input is empty and naming them correctly.