I have an first $array1 of 200 integer values,$array1 integer values are random values and second array say as below
$array2= array('30','40,'70','30','30');
Both the arrays are generating dynamically.
I want to divide my $array1 into smaller arrays as per $array2 values, as first 30 integers from $array1 will make separate array, later 40 intergers from $array1 will make second new array and so on. From above example there will be 5 new arrays.
Can anyone please help me.
I tried below below it can just divide based on values assigned. But it is not useful
$arrays = array_chunk($array1, 30);