Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php] problem z foreach?
-Kaller-
post 4.05.2008, 14:45:38
Post #1





Goście







  1. <?php
  2. $this->res[] = array(
  3.  
  4. 'id' => $this->data[2][$this->key],
  5. 'title' => $this->data[4][$this->key],
  6. 'time' => $this->data[5][$this->key],
  7. 'size' => $this->data[6][$this->key]
  8.  
  9. );
  10. ?>


I mam taki problem zwraca mi 6 wyników tylko - chociaż powinno 16

print_r($this->key);

zwraca:

0123456

W czym problem może być?

  1. <?php
  2. [1] => Array
  3. (
  4. [0] => 0
  5. )
  6.  
  7. [2] => Array
  8. (
  9. [0] => 1356
  10. )
  11.  
  12. [3] => Array
  13. (
  14. [0] => 0
  15. )
  16.  
  17. [4] => Array
  18. (
  19. [0] => TurboXP
  20. )
  21.  
  22. [5] => Array
  23. (
  24. [0] => 0
  25. )
  26.  
  27. [6] => Array
  28. (
  29. [0] => 3,20 MB
  30. )
  31.  
  32. )
  33. ?>
Go to the top of the page
+Quote Post
Cysiaczek
post 4.05.2008, 15:48:50
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Co pokazuje
  1. <?php
  2. print_r($this->res); // ?
  3. ?>


Jeśli wyświetlasz jeden tylko klucz ($this-key), to nic dziwnego, że Ci pokazuje ograniczone wyniki.

Pozdrawiam


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
-Kaller-
post 4.05.2008, 15:51:41
Post #3





Goście







http://www.nopaste.pl/4d8
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 12.06.2025 - 23:29