DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

Matt Ford's picture

Unregistered

Feeds

aliases

  • Matt Ford

Matt Ford

11 months ago

in How to pull statistics from Icecast with PHP on th1nk
Thanks for the code.

I am totally new to PHP and found that it wouldn't run at first on my hosting company's server (which is running PHP 5). I found that I needed to change the line

require_once('icestats.php');

in the example page to

include 'icestats.php';

Otherwise I got a 'class declared twice' error or something like that.

Also for those people like me who don't have a clue how to extract individual fields from the returned object, after a bit of trial and error (!) it turns out you can do it like this:

For example, to print the current artist:

echo $stats->artist[0];

Basically change 'artist' above for whatever other field your are interested in..

Thanks again for sharing your code -
Matt
Returning? Login