Autor Zpráva
Danm
Profil
Ahoj, můžete mi prosím někdo pomoct s tímto? Potřeboval bych to seřadit česky, ale ve funkci array_multisort není parametr SORT_LOCALE_STRING, ale jenom LOCALE_STRING, která to česky neseřadí. :(
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>

<?php
setlocale(LC_ALL, 'cs_CZ.UTF-8');

$Data = Array
(
    1 => Array
    	  (
    	  		0 => "0",
    	  		1 => "cipísek",
    	  		2 => "15",
    	  		3 =>"" ,
    	  		4 => "10,00",
    	  		5 =>"" ,
    	  		6 =>"1"
    	  ),
    2 => Array
        (
            0 => "0" ,
            1 => "dd" ,
            2 => "17" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    3 => Array
        (
            0 => "0" ,
            1 => "df" ,
            2 => "23" ,
            3 => "" ,
            4 => "1,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    4 => Array
        (
            0 => "0" ,
            1 => "modrý kůň" ,
            2 => "3" ,
            3 => "ano" ,
            4 => "100,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    5 => Array
        (
            0 => "0" ,
            1 => "příslušenství" ,
            2 => "4" ,
            3 => "" ,
            4 => "100,00" ,
            5 => "<p>drhj řečj</p>" ,
            6 => "1" ,
        ),

    6 => Array
        (
            0 => "0" ,
            1 => "ww" ,
            2 => "18" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    7 => Array
        (
            0 => "0" ,
            1 => "ww" ,
            2 => "19" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    8 => Array
        (
            0 => "0" ,
            1 => "ww" ,
            2 => "20" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    9 => Array
        (
            0 => "0" ,
            1 => "zuzana" ,
            2 => "12" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    10 => Array
        (
            0 => "0" ,
            1 => "šalda" ,
            2 => "11" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    11 => Array
        (
            0 => "1" ,
            1 => "řepa" ,
            2 => "2" ,
            3 => "" ,
            4 => "54,00" ,
            5 => "<p>Lorem ipsum dolor sit amet</p>" ,
            6 => "1" ,
        ),

    12 => Array
        (
            0 => "1" ,
            1 => "aa" ,
            2 => "16" ,
            3 => "" ,
            4 => "100,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    13 => Array
        (
            0 => "1" ,
            1 => "adam" ,
            2 => "9" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    14 => Array
        (
            0 => "1" ,
            1 => "candát" ,
            2 => "8" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        ),

    15 => Array
        (
            0 => "1" ,
            1 => "chleda" ,
            2 => "7" ,
            3 => "" ,
            4 => "10,00" ,
            5 => "" ,
            6 => "1" ,
        )

);

foreach ($Data as $key => $row) {
    $klic[$key]  = $row['1'];
}

array_multisort($klic, SORT_LOCALE_STRING, $Data);
print_r($Data);
?>  
</body>
</html>

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: