I am newbie programmer of php. How should I create array without specifying the size of array.I have tried using
$items = array();
How can add array as the element? Without having to specify the index. Thanks in advance for any feedback.
I am newbie programmer of php. How should I create array without specifying the size of array.I have tried using
$items = array();
How can add array as the element? Without having to specify the index. Thanks in advance for any feedback.
// define array
$item = array();
// adding multi dimensional array
array_push($item, array('name'=>'Pen','qty'=>1));
You may nest the array to even more levels by same method as mentioned above.