Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 表单的多维数组_Php_Multidimensional Array_Validation - Fatal编程技术网

Php 表单的多维数组

Php 表单的多维数组,php,multidimensional-array,validation,Php,Multidimensional Array,Validation,我想用PHP检查我的输入表单 我想用错误的inputsbox名称和原因填充一个数组 但我不知道我是怎么得到它的 e、 g 谁能帮帮我吗?$false=array(); $false = array(); if (!isset($_POST['name']) OR $_POST['name'] == "") { $false['name'][] = 'Sorry the name is missing!'; } if (strlen($_POST['name']) < 3) {

我想用PHP检查我的输入表单

我想用错误的inputsbox名称和原因填充一个数组

但我不知道我是怎么得到它的

e、 g

谁能帮帮我吗?

$false=array();
$false = array();

if (!isset($_POST['name']) OR $_POST['name'] == "") {
    $false['name'][] = 'Sorry the name is missing!';
}

if (strlen($_POST['name']) < 3) {
    $false['name'][] = 'Sorry the name is to short!';
}
如果(!isset($\u POST['name'])或$\u POST['name']==“”){ $false['name'][]=“对不起,名称丢失!”; } 如果(strlen($_POST['name'])<3){ $false['name'][]=“对不起,名称太短了!”; }
$false=array()$false[]=$\u POST;类似的东西?不。在我的示例中,我在数组“false”中写入输入“name”,现在我想把原因放到数组kay“name”。$false=array()$false['name'][=$\u POST['name'];威尔·沃克索里刚刚意识到我下面的人发了一封信,感谢它能起作用。。。但是现在我在数组中找不到键名。我想测试:if(在数组中('name',$false)){//do something}if('false['name']){//do something}if(数组中存在('name',$false)){//do something}
false
(
    [0] => name
                (
                    [0] => Sorry the name is missing!
                    [1] => Sorry the name is to short!
                    [2] => etc etc
                )
    [1] => etc
                (
                    [0] => etc etc
                )
)
$false = array();

if (!isset($_POST['name']) OR $_POST['name'] == "") {
    $false['name'][] = 'Sorry the name is missing!';
}

if (strlen($_POST['name']) < 3) {
    $false['name'][] = 'Sorry the name is to short!';
}