public static function compare($string, $value, $length = 0) {
        $string = (string) $string;
        $value = (string) $value;

        if ($length > 0) {
            return strncasecmp($string, $value, $length);
        }

        return strcasecmp($string, $value);
    }
public static function compare($string, $value, $length = 0) {
        $string = (string) $string;
        $value = (string) $value;

        if ($length > 0) {
            return strncasecmp($string, $value, $length);
        }

        return strcasecmp($string, $value);
    }
public static function compare ( $ string , $ value , $ length = 0 ) { $ string = ( string ) $ string ; $ value = ( string ) $ value ; if ( $ length > 0 ) { return strncasecmp ( $ string , $ value , $ length ) ; } return strcasecmp ( $ string , $ value ) ; }
Compares to strings alphabetically. Returns 0 if they are equal, negative if passed value is greater, or positive if current value is greater.

@param string $string
@param string $value
@param int $length
@return int
Compares to strings alphabetically . Returns 0 if they are equal negative if passed value is greater or positive if current value is greater .