This code doesn’t work > <b>Fatal error</b>: Cannot use [] for reading i
<select style=" width:200px" class="mydds" name="myformdata[user][]">
this is what is sent.
myformdata[user][] 1
myformdata[user][] 2
myformdata[user][] 3
foreach($form['user'][] as $val){
echo ($val);
}
what is the problem ?
It’s a syntax error. The correct syntax is:
The
[]syntax is used for appending data to an array. For example:The above will add a new string to the
$form['user']array with the value oftest.