How can I take several elements from the array at once? Like foreach is for only one, how can I get more than one in each iteration?
$data = array(1,2,3,4,5,6);
foreach($data as $a and $b) // pseudocode
{
echo $a + $b;
}
Is there a way to do it?
You can try
foreachloop usingarray_chunkForLoopwhileloopOutput