0

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

user_777
  • 845
  • 1
  • 9
  • 25

1 Answers1

0

Do it as below.

$a= array("12:00","12:20","12:40","01:00");
$b= array("02:00","02:20");

$merge = array_merge($a, $b);

var_dump($merge);
Pang
  • 9,564
  • 146
  • 81
  • 122
Boopathi D
  • 361
  • 2
  • 21