How to define variable inside array without key? This doesnt working and I dont know how...
$array = array("list" => array());
$list = $array["list"][] = array("sub_list" = array());
$list["sub_list"][] = "text1";
$list["sub_list"][] = "text2";
$list["sub_list"][] = "text2";
$list2 = $array["list"][] = array("sub_list" = array());
$list2["sub_list"][] = "text1";
$list2["sub_list"][] = "text2";
$list2["sub_list"][] = "text3";
Needed result:
$array = array(
"list" => array(
array(
"sub_list" = array("text1", "text2", "text3")
),
array(
"sub_list" = array("text1", "text2", "text3")
)
)
);
It's not used in loop or for/foreach!
"sub_list" = array()it should be=>=>but same problem -sub_listare always empty arrays