Dear Friends,
With the Help of my Friend Vishnu A.R I solved the issue
my required Code is
<?php
$selectedTime = "2017-02-10 08:00,2017-02-10 07:00,2017-02-11 09:00";
$arr1 = explode(",", $selectedTime);
$arr2 = array();
foreach($arr1 as $time){
$strtime = strtotime($time);
$arr2[$strtime] = $time;
}
ksort($arr2); // sorting array in ascending order of key value
$arr3 = array();
foreach($arr2 as $key => $time){
$timesplit = explode(" ", $time);
$arr3[$timesplit[0]][] = array('start' => $timesplit[1]);
}
$output = json_encode($arr3);
var_dump($output);
?>
Thanks
Anes