wc_ascii_uasort_comparison( string $a, string $b )

Sort values based on ascii, usefull for special chars in strings.


Description Description


Parameters Parameters

$a

(Required) First value.

$b

(Required) Second value.


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/wc-core-functions.php

function wc_ascii_uasort_comparison( $a, $b ) {
	if ( function_exists( 'iconv' ) && defined( 'ICONV_IMPL' ) && @strcasecmp( ICONV_IMPL, 'unknown' ) !== 0 ) {
		$a = @iconv( 'UTF-8', 'ASCII//TRANSLIT//IGNORE', $a );
		$b = @iconv( 'UTF-8', 'ASCII//TRANSLIT//IGNORE', $b );
	}
	return strcmp( $a, $b );
}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.