如何将表单输入数组转换为PHP数组
<input type="text" name="name[]" /><input type="text" name="email[]" /><input type="text" name="name[]" /> <input type="text" name="email[]" /><input type="text" name="name[]" /><input type="text" name="email[]" />
$name = $_POST['name'];$email = $_POST['account'];foreach( $name as $v ) {print $v;}foreach( $email as $v ) {print $v;}
name1name2name3email1email2email3
function show_Names($n, $m){return("The name is $n and email is $m, thank you");}$a = array("name1", "name2", "name3"); $b = array("email1", "email2", "email3");$c = array_map("show_Names", $a, $b);print_r($c);
名字是 名1电子邮件是 电邮1,谢谢 名字是 名称2电子邮件是 电邮2,谢谢 名字是 名称3电子邮件是 电邮3,谢谢
莫回无
千巷猫影