Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Wyciąganie danych z tablic
czvpka
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 1
Dołączył: 22.02.2017

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


Witam. Mam taką oto tablicę $users:
Kod
array(3) {
  ["success"]=>
  bool(true)
  ["errors"]=>
  NULL
  ["data"]=>
  array(5) {
    [0]=>
    array(5) {
      ["clid"]=>
      string(1) "2"
      ["cid"]=>
      string(3) "380"
      ["client_database_id"]=>
      string(1) "1"
      ["client_nickname"]=>
      string(35) "serveradmin from 94.254.153.85:9253"
      ["client_type"]=>
      string(1) "1"
    }
    [1]=>
    array(5) {
      ["clid"]=>
      string(1) "6"
      ["cid"]=>
      string(3) "380"
      ["client_database_id"]=>
      string(3) "275"
      ["client_nickname"]=>
      string(22) "MusicBot ☆ HiveSpeak"
      ["client_type"]=>
      string(1) "0"
    }
    [2]=>
    array(5) {
      ["clid"]=>
      string(2) "16"
      ["cid"]=>
      string(3) "380"
      ["client_database_id"]=>
      string(1) "1"
      ["client_nickname"]=>
      string(21) "PokeBot ☆ HiveSpeak"
      ["client_type"]=>
      string(1) "1"
    }
    [3]=>
    array(5) {
      ["clid"]=>
      string(2) "19"
      ["cid"]=>
      string(3) "380"
      ["client_database_id"]=>
      string(1) "1"
      ["client_nickname"]=>
      string(26) "Aktualizator ☆ HiveSpeak"
      ["client_type"]=>
      string(1) "1"
    }
    [4]=>
    array(5) {
      ["clid"]=>
      string(2) "20"
      ["cid"]=>
      string(3) "380"
      ["client_database_id"]=>
      string(1) "1"
      ["client_nickname"]=>
      string(21) "TimeBot ☆ HiveSpeak"
      ["client_type"]=>
      string(1) "1"
    }
  }
}

I chciałbym z tego wyciągnąć każdą wartość "clid". Wynalazłem, że aby wyciągnąć wszystkich użytkowników, muszę użyć $users['data'], lecz co muszę zrobić dalej, aby wyciągnąć wszystkie "clid"? Proszę o pomoc. Pozdrawiam (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
ohm
post
Post #2





Grupa: Zarejestrowani
Postów: 623
Pomógł: 144
Dołączył: 22.12.2010

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


sprobuj array_column($array['data'], "clid")

Ten post edytował ohm 24.02.2017, 15:38:27
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: 26.09.2025 - 08:43