i have a array and i want to split it on based on type
and i have this example
$timeless=array();
$ontime=array();
foreach($myArray as $item) {
if (preg_match("/hidden$/i", $item)) {
array_push($timeless, $item);
} else {
array_push($ontime, $item);
}
i have an array which have 20 record and every records contained a key prayerType
which is 0
OR 1
.
- 1 for Timeless
- 0 for ontime