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