i have two time values as give below
$row2[0]=00:40:00;
$row1[5]=14:00:00;
$time=14:33:00
$time=$row[1];
i am combining $row2[0],$row1[5] like below
$secs = strtotime($row2[0])-strtotime("00:00:00");
$result = date("H:i:s",strtotime($row1[5])+$secs);
$result=14:40:00
i use if condition as shown
if($row[1]>$row1[5] && $row[1]<$result)
{
$message=array("status"=>$result);
}
else
{
$message=array("status"=>'');
}
but i get "status"=>"" its not correct
i want to get "status"=>"14:40:00"
please help us for getting correct out put
You don’t appear to define
$row[1]anywhere, so it is treated asNULL, which as an integer is0, which cannot be greater than the time you have given in$row1[5].Try using less ambiguous variable names, it might make it easier to spot problems like this.
Personally I don’t see why that
ifis there at all, just remove it and theelseblock, leaving just$message = array("status"=>$result);.