public static function lengthSort($val_1, $val_2)
    {
        // initialize the return value to zero
        $retVal = 0;

        // compare lengths
        $firstVal = strlen($val_1);
        $secondVal = strlen($val_2);

        if ($firstVal > $secondVal) {
            $retVal = 1;
        } elseif ($firstVal < $secondVal) {
            $retVal = -1;
        }

        return $retVal;
    }
public static function lengthSort($val_1, $val_2)
    {
        // initialize the return value to zero
        $retVal = 0;

        // compare lengths
        $firstVal = strlen($val_1);
        $secondVal = strlen($val_2);

        if ($firstVal > $secondVal) {
            $retVal = 1;
        } elseif ($firstVal < $secondVal) {
            $retVal = -1;
        }

        return $retVal;
    }
public static function lengthSort ( $ val_1 , $ val_2 ) { // initialize the return value to zero $ retVal = 0 ; // compare lengths $ firstVal = strlen ( $ val_1 ) ; $ secondVal = strlen ( $ val_2 ) ; if ( $ firstVal > $ secondVal ) { $ retVal = 1 ; } elseif ( $ firstVal < $ secondVal ) { $ retVal = - 1 ; } return $ retVal ; }
Sort an array based on the strings length

@access private

@param  string $val_1
@param  string $val_2

@return int
Sort an array based on the strings length