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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -