假设我有一个包含多个此类实例的数组:
class Booking
{
public $status;
public $start_time;
public $end_time;
}
array[0] $status = true $start_time = 13:30 $end_time = 14:00
array[1] $status = true $start_time = 14:30 $end_time = 17:30
array[2] $status = true $start_time = 20:30 $end_time = 21:30
array[3] $status = true $start_time = 22:00 $end_time = 23:30
我怎么能详细说明一个给定时间的函数,比如12:00
并23:00
生成一个数组,该数组具有同一个类的多个实例,尽管有这样的东西:
array[0] $status = false $start_time = 12:00 $end_time = 13:30
array[1] $status = true $start_time = 13:30 $end_time = 14:00
array[2] $status = false $start_time = 14:00 $end_time = 14:30
array[3] $status = true $start_time = 14:30 $end_time = 17:30
array[4] $status = false $start_time = 17:30 $end_time = 20:30
array[5] $status = true $start_time = 20:30 $end_time = 21:30
array[6] $status = false $start_time = 21:30 $end_time = 22:00
array[7] $status = true $start_time = 22:00 $end_time = 23:00