- print_r: documentation ( source)
- array_filter: documentation ( source)
- strtotime: documentation ( source)
<?php
$cars=array("09:00","09:30","10:00","10:30","11:00","11:30","12:00","12:30");
$start = "09:30";
$end = "10:30";
$cars = array_filter($cars, function ($v) use ($start, $end) {
return strtotime($v) < strtotime($start) || strtotime($v) > strtotime($end); });
print_r($cars);