how to push more data into the array after finishing the loop in php? -
im trying here php, want after loop finishes looping data array add more data array , again start looping.
i.e.
foreach($arraydata->data $item) { echo $item->id; } //add more data $arraydata //and foreach loop again
i dont if impossible thought let me give try , ask, thank. ps. not code on page, tried make simple fro eyes :))
i guess can either of following
use
array_push($arraydata->data, "val1", "val2");
or use simple array assignment like
$arraydata->data["another key"] = "another value";
i assuming $arraydata->data array
by of thing $item object too. replace string values objects
Comments
Post a Comment