Here my outcome looks like this, please have a look
array(4)
{
[0]=> string(5) "12:00"
[1]=> string(5) "12:20"
[2]=> string(5) "12:40"
[3]=> string(5) "01:00"
}
array(2)
{
[0]=> string(5) "02:00"
[1]=> string(5) "02:20"
}
Here is my code
$t_i=$this->Hospital_model
->get_time_interval_break_split(
$t_i_b->start,
$t_i_b->end,
$consult_time);
$output =array_merge($t_i);
Here is my model
public function get_time_interval_break_split($start_time,$end_time,$consult_time)
{
$array = array();
$time_diff = $consult_time * 60;
if(!empty($start_time))
{
for ($i=strtotime($start_time); $i<=strtotime($end_time); $i += $time_diff)
{
$array[] = date("h:i", $i);
}
}
return $array;
}
now i want to combine those two arrays in to one and i had used array_map
,array_merge
and all but didn't got a solution,please help me to solve