Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Sortowanie wielowymiarowych tablic, problemik, tylko dla mocnych
ganimedes
post
Post #1





Grupa: Zarejestrowani
Postów: 66
Pomógł: 0
Dołączył: 1.04.2004

Ostrzeżenie: (0%)
-----


Mam sobie taką tablice...
  1. <?php
  2. (
  3.     [1] => Array
  4.         (
  5.             [0] => 1
  6.             [1] => 1
  7.             [2] => 1
  8.             [3] => 0
  9.         )
  10.  
  11.     [2] => Array
  12.         (
  13.             [0] => 4
  14.             [1] => 1
  15.             [2] => 0
  16.             [3] => 0
  17.         )
  18.  
  19.     [4] => Array
  20.         (
  21.             [0] => 1
  22.             [1] => 0
  23.             [2] => 0
  24.             [3] => 1
  25.         )
  26.  
  27.      [3] => Array
  28.         (
  29.             [0] => 1
  30.             [1] => 1
  31.             [2] => 0
  32.             [3] => 0
  33.         )
  34.  
  35. ?>


Jak posortować ją zeby wyglądała tak
  1. <?php
  2. (
  3.     [2] => Array
  4.         (
  5.             [0] => 4 // chodzi mi o tą wartość 
  6.             [1] => 1 // potem o tą 
  7.             [2] => 0 // next
  8.             [3] => 0 // itd
  9.         )
  10.  
  11.     [1] => Array
  12.         (
  13.             [0] => 1
  14.             [1] => 1
  15.             [2] => 1
  16.             [3] => 0
  17.         )
  18.  
  19.     [3] => Array
  20.         (
  21.             [0] => 1
  22.             [1] => 1
  23.             [2] => 0
  24.             [3] => 0
  25.         )
  26.    
  27.     [4] => Array
  28.         (
  29.             [0] => 1
  30.             [1] => 0
  31.             [2] => 0
  32.             [3] => 1
  33.         )
  34.  
  35. ?>

Próbowałem funkcji
  1. <?php
, nie działa, nie zachowuje kluczy (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Problem dla speców.. kto rozwiąże ten jest bardzo dobry.

Regards

Ten post edytował ganimedes 23.11.2004, 22:09:20
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 20:55