如何在“邻接”键值对中推送数组,该键值对应该有一个包含“数组”的封装数组(即。array((“nodeTo”=>“$to”),(“nodeTo”=>“$to "))) 而不覆盖它们并将它们附加到类似于“+=”。对关键“邻接”的推动似乎也没有增加价值。
$node[] = array(
"adjacencies" => array(), //inside this array should go all the arrays seprated by commas.
"data" => array(
"color" => $color1,
"type" => $type1
);
// this push doesnt seem to detect the adjacencies value and doesnt really push the array inside of the container array. I also tried $node["adjacencies"][]=array("nodeTo" => "$to"); but it didnt work
$node["adjacencies"]=array("nodeTo" => "$to");
}