让我用我的代码解释我的问题。这有效:
$multiarray = array(
'multikey1' => '',
'multikey2' => ''
);
$array = array(
'key1' => '',
'key2' => '',
'key3' => '',
'key4' => $multiarray
);
print_r($array);
这不起作用:
class Array {
public static $multiarray = array(
'multikey1' => '',
'multikey2' => '',
'multikey3' => ''
);
public $array = array(
'key1' => '',
'key2' => self::$multiarray
);
}
$array = new Array;
不幸的是,这不起作用。知道如何解决这个问题吗?