Strona 1 z 1

file_get_contents

: 09 gru 2014, 19:26:05
autor: Sepowaty
Witam,

chciałbym z pliku API (http://api.mizure.net/channel/bialenia) wyciągnąć liczbę osób na kanale ("users_count") i wyświetlić tę liczbę na stronie głównej. Wiem, że można to zrobić za pomocą file_get_contents, ale jedynie mi się wyświetla zmienna...

Re: file_get_contents

: 09 gru 2014, 20:52:27
autor: rkd77
Sepowaty,

Kod: Zaznacz cały

$obj = json_decode(file_get_contents($url));
echo $obj->users_count;