Table of contents Home page
setlocale(LC_ALL, 'sve_sve'); // Use the order of the Swedish alphabet $a = 'alpha'; $b = 'beta'; echo strcasecmp($a, $b), "\n"; // 'alpha' sorts before 'beta') echo strcasecmp($b, $a), "\n"; // 'beta' sorts after 'alpha') echo strcasecmp($a, $a), "\n"; // 'alpha' == 'alpha' echo strcasecmp('Alpha', $a), "\n"; // Case differences don't matter $a = 'mat'; $b = 'ål'; // In the Swedish alphabet 'm' sorts before 'å'! echo strcasecmp($a, $b), "\n"; // 'mat' sorts before 'ål' echo strcasecmp($b, $a), "\n"; // 'ål' sorts after 'mat'