Split an array into chunks of two:


SUBMITTED BY: henry1874w

DATE: June 22, 2017, 12:07 a.m.

FORMAT: Text only

SIZE: 109 Bytes

HITS: 119

  1. <?php
  2. $cars=array
  3. ("Volvo","BMW","Toyota","Honda","Mercedes","O
  4. pel");
  5. print_r(array_chunk($cars,2));
  6. ?>

comments powered by Disqus