有没有办法在 Javascript 中初始化空数组,在 php 中初始化相同的空数组?
$blah = array("0" => "wew", "1" => "fdafa");
foreach ($blah as $blat => $val) {
$arr[] = $val
$arr[$blah][] = 1;
}
要不就
foreach ($blah as $blat => $val) {
$arr[] = $val
}