Date Comparison Function for `usort()`
Magic numbers are a bad code smell and should be avoided. Use a constant instead.


In your definition of dateSort(), your third parameter is format=1. What does 1 mean? Without reviewing the code it isn't clear which makes maintaining the code more difficult. A common way to avoid this is to define constants with human readable names and use them in place of the magic numbers. Note that the names of these constants are arbitrary. Name them in such a way that makes sense to the reader what value they hold or reflect.

 defined('DATE_FORMAT_EU_SLASHES') || define('DATE_FORMAT_EU_SLASHES', 0);
 defined('DATE_FORMAT_US')         || define('DATE_FORMAT_US', 1);
 defined('DATE_FORMAT_YEAR_FIRST') || define('DATE_FORMAT_YEAR_FIRST', 2);



Using date_parse() is okay but working with DateTime() objects is preferred. 


PHP offers a lot of ways of working with dates which can be a good or bad thing. In general using DateTime() objects are preferred as they were designed specifically for this purpose (and is the most powerful). 

Your code can be simplified as DateTime() can parse most date formats natively and also handle not standard formats easily. date_parse() will fail once the format becomes non-standard or irregular.

Additionally, DateTime() objects are comparable so you don't need to output a string variable in a comparable format to do your comparison. Just compare the objects themselves.

$datetime1 = new DateTime($date1);
$datetime2 = new DateTime($date2);
return datetime1 &lt;=&gt; datetime2;


Simpler!    


Use a switch statement instead of a potentially giant if/else    


Because we can have situations where DateTime() can handle the format natively, there is no need to have an if/else statement for every date format. switch allows us to allow conditions to be handled by the same code block. It also offers us a default option which means we no longer need to define our default format in the function signature and can let the switch statement handle it for us.

defined('DATE_FORMAT_EU_SLASHES') || define('DATE_FORMAT_EU_SLASHES', 0);
defined('DATE_FORMAT_US')         || define('DATE_FORMAT_US', 1);
defined('DATE_FORMAT_YEAR_FIRST') || define('DATE_FORMAT_YEAR_FIRST', 2);

function dateSort($date1, $date2, $format = null)
    switch ($format) {
        case DATE_FORMAT_EU_SLASHES :
            // DateTime::createFromFormat() offers us flexibility
            $datetime1 = DateTime::createFromFormat('d/m/Y', $date1);
            $datetime2 = DateTime::createFromFormat('d/m/Y', $date2);
            break;
        case DATE_FORMAT_US :
        case DATE_FORMAT_YEAR_FIRST :
        default :
            // DateTime() can handle both formats natively so no need to handle them 
            // individually. You can also ad formats like YYYY-MM-DD with only a couple 
            // of lines of code
            $datetime1 = new DateTime($date1);
            $datetime2 = new DateTime($date2);
            break;
    }
    return datetime1 &lt;=&gt; datetime2;
}   


If you want to take it a step further, you could simplify your code and only specify when the format is non-standard and handle them specifically. Otherwise, fall to the default date handler:

defined('DATE_FORMAT_EU_SLASHES') || define('DATE_FORMAT_EU_SLASHES', 0);

function dateSort($date1, $date2, $format = null)
    switch ($format) {
        case DATE_FORMAT_EU_SLASHES :
            $datetime1 = DateTime::createFromFormat('d/m/Y', $date1);
            $datetime2 = DateTime::createFromFormat('d/m/Y', $date2);
            break;
        default :
            $datetime1 = new DateTime($date1);
            $datetime2 = new DateTime($date2);
            break;
    }
    return datetime1 &lt;=&gt; datetime2;
}   


*None of this code is tested -- I just wrote it off of the top of my head -- but hopefully it gives you ideas about how to improve this code