    function order_ignore_the($a, $b){     // orders sentences ascending alphabetically, ignoring the  work the     $args = func_get_args();     foreach($args as $k=>$v){          $sort = explode( ,$v);          $args[$k] = (strtolower($sort[0]) == the ? $sort[1] : $sort[0]);     }    return strcmp($args[0], $args[1]);}usort($array_of_sentences,'order_ignore_the');
Sort an array of sentence aphabbetically, ignoring the first word if it equals 'the' (case insensitive)
php
I'm not sure what you're doing there, but I think it can get shortened to this.function order_ignore_the($a, $b) {    return strcmp(        strcasecmp(substr($a, 0, 3), the) != 0 ? $a : substr($a, 3),        strcasecmp(substr($b, 0, 3), the) != 0 ? $b : substr($b, 3)    );}Be warned that this is not tested.Edit: Long version with explanation:function order_ignore_the($a, $b) {    // Variables for later use    $checkedA = $a;    $checkedB = $b;    // Compare the first three letters case-insensitive against the    if(strcasecmp(substr($checkedA, 0, 3), the) == 0) {        // strip the the from the string        $checkedA = substr($checkedA, 3);    }    // Repeate for $b    if(strcasecmp(substr($checkedB, 0, 3), the) == 0) {        $checkedB = substr($checkedB, 3);    }    // Compare both strings    return strcmp($checkedA, $checkedB);}Yes, it's swapped, I'm checking in the short version if the string does not match the, and here I'm checking if it does match.