guys i am storing dates like these 07/01/2016, 07/02/2016, 07/03/2016, 07/04/2016 in db and when i fetch these dates from db using mysql_fetch_array() the result is the whole array now i want to get only the starting and ending date i.e 07/01/2016 and 07/04/2016...i tried using explode function but explode function breaks a string into an array...and i am unable to find a String To Array function in php...Kindly help me and tell me what should i do...
$leave_dates=$_POST['dates'];
$check_dates=explode(',', $leave_dates);
foreach ($check_dates as $date)
{
# code...
$count_dates=count($date);
//THIS GIVES THE COUNT OF DATES E.G 4
NOW I WANT TO ACCESS THE FIRST AND THE LAST ELEMENT
}
$check_dates[0]and for last$check_dates[count($check_dates)-1]and also check by isset first$check_dates[0]and for last:$check_dates[(sizeof($check_dates)-1)]