<?php $myArray = ['a','b','c','title1','d','e','f','title2','g','h','title3','i','title4','j','k']; $batch = 0; foreach ($myArray as $v) { if (strpos($v, 'title') !== 0) { $result[$batch][] = $v; } else { ++$batch; } } var_export($result);
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`