For purposes of study and better understanding I'm trying to make an array inside another array by adding values using array_push, follow my example:
<?php
$ar1 = array();
array_push($ar1, 1, 2, 3, 4);
foreach($ar1 as $ar) {
$ar2 = array();
array_push($ar2, 5, 6, 7, 8);
array_push($ar1, $ar2);
foreach($ar1 as $ar) {
echo $ar . "";
}
}
Notice: Array to string conversion in D: \ StudyPHP \ arrays.php on line 12 Array1234
As per error, I do not understand the correct logic for this.