![]() |
![]() ![]() |
![]() |
---Gregor--- |
![]()
Post
#1
|
Goście ![]() |
Plik JSON:
[‹"embed_count":"3204","name":"username","s_count":"5900","category":"gaming","format":"live","_count":9538›] Dostaję w PHP: Array ( [0] => Array ( [embed_count] => 3216 [name] => username [s_count] => 5900 [category] => gaming [format] => live [_count] => 9538 ) Kod: $json_file = @file_get_contents("...", 0, null, null); $json_array = json_decode($json_file, true); $this->guests= $json_array[0]['_count']; I uwagach mam: Undefined offset: 0 in ... Ktoś mi może to wytłumaczyć? |
|
|
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 1 233 Pomógł: 87 Dołączył: 6.03.2009 Ostrzeżenie: (40%) ![]() ![]() |
Jest różnica miedzy jsonem używamy przez javascript a php.
Sprobuj tego: http://pear.php.net/package/Services_JSON |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 12:40 |