Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] tablice
atomp3
post
Post #1





Grupa: Zarejestrowani
Postów: 126
Pomógł: 1
Dołączył: 31.03.2006

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


Witam

mam taka tablice

Array ( [0] => Array ( [ID] => 11 [userName] => YXRvbXAz [userPass] => [isAdmin] => 0 [userGroup] => 0 [sessionID] => [lastLog] => 2007-06-18 09:08:31 [title] => Mr [name] => SK [surname] => [email] => a@aa.com [birth_day] => [birth_month] => [birth_year] => [postcode] => [address] => [telephone] => [mobile] => [private] => [other] => [activated] => ON )
[1] => Array ( [ID] => 12 [userName] => R29yZG9u [userPass] => [isAdmin] => 0 [userGroup] => 0 [sessionID] => [lastLog] => 2007-06-18 09:09:39 [title] => Mr [name] => GMB [surname] => [email] => a@aa.com [birth_day] => [birth_month] => [birth_year] => [postcode] => [address] => [telephone] => [mobile] => [private] => [other] => [activated] => ) ) 0

wpisujac:
  1. <?php
  2. foreach($_data as $key=>$v) {
  3. echo '<B>' . $key . '</b><br />';
  4. foreach($_data[$key] as $s) {
  5. echo $s ;
  6. }
  7. }
  8. ?>


uzyskuje
11YXRvbXAz002007-06-18 09:08:31MrSKa@aa.comON1
12R29yZG9u002007-06-18 09:09:39MrGMBa@aa.com

Moje pytanie to jak dostac sie do 2 elementu (kolumny) czyli userName? musze to pozniej przyrownac.

Ten post edytował strife 18.06.2007, 13:35:36
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
kszychu
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 712
Pomógł: 23
Dołączył: 27.10.2003
Skąd: z kontowni

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


  1. <?php
  2. foreach($_data as $key => $v)
  3.  echo $_data[$key]['userName'].'<br />';
  4. ?>


Przenoszę do przedszkola.
Go to the top of the page
+Quote Post
atomp3
post
Post #3





Grupa: Zarejestrowani
Postów: 126
Pomógł: 1
Dołączył: 31.03.2006

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


Dzieki wlasnie o to mi chodzilo (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

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: 24.08.2025 - 23:06