<?php
$start = "07/01/2015-08/01/2015";
//split the start and end date in to 2 and compare both to a real date to make sure they're valid
$newdate = explode("-", $start);
echo 1;
//make sure date 2 is set
if(!isset($newdate[1])): echo "No date 2\n"; endif;
//check if newdate 0 and 1 are real dates
$date1 = DateTime::createFromFormat('M-d-Y', str_replace("/","-",$newdate[0]));
$date2 = DateTime::createFromFormat('M-d-Y', str_replace("/","-",$newdate[1]));
echo str_replace("/","-",$newdate[0]);
//not valid dates
if($date1 == false || $date2 == false): echo "Invalid dates\n"; endif;
echo 4;