我的结果如下所示,请看看
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"
}
这是我的代码
$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);
这是我的模特
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;
}
现在我想将这两个数组合并为一个,我曾使用过array_map
,array_merge
但所有人都没有得到解决方案,请帮我解决
答案 0 :(得分:0)
如下所示。
$a= array("12:00","12:20","12:40","01:00");
$b= array("02:00","02:20");
$merge = array_merge($a, $b);
var_dump($merge);