Sort an array of sentences alphabetically, ignoring the first word if it equals 'the' (case insensitive)
With some testing, it should look like the below

function order_ignore_the($a, $b) {
    return strcasecmp(
        strcasecmp(substr($a, 0, 4), "the ") != 0 ? $a : substr($a, 4),
        strcasecmp(substr($b, 0, 4), "the ") != 0 ? $b : substr($b, 4)
    );
}


Main differences being:


Widening the search for "the" to include the space after. Otherwise, you're matching on things like "theater", etc.
The last substr should likewise have start position 4. Otherwise, you're comparing on the space after "the".
You'll want the main comparison to ignore capitalization, too.