如何创建这样的php数组? [关闭]

$arr = array(
    array(
    'A'=>0,
    'B'=>0,
    'C'=>0,
    'D'=>0,
    'E'=>0
    ),
    array(
    'A'=>1,
    'B'=>0,
    'C'=>0,
    'D'=>0,
    'E'=>0
    )
    .......
)

In this array, every A B C D E has both 0 and 1 condition. But I don't know how to create an array like this.

I assuming you are going to dynamically add the 0 and 1 values against your A,B,C,D,E in the arrays.

$count = 10; // This is the number of objects you want to add to your master array, which you can either keep static or compute dynamically.
$valueA = 0; // Similarly define all your values against A,B,C,D,E here.

$dynamicArray = array();
for($i=0;$i<$count;$i++)
{
   $dynamicArray[$i] = array("A"=>$valueA,"B"=>$valueB,"C"=>$valueC,"D"=>$valueD,"E"=>$valueE);
}

Your question is somewhat unclear, but I think standard functions like array_fill_keys, array_fill and array_combine might be of use.

Seriously, php.net is such a great site.