Foreach loop with the array of a public function
Posted: Thu Apr 10, 2008 1:53 pm
Hi, i need to do a loop of the array of this function found in the WebUI API:
WebUI API: http://pastebin.com/m76205d0b
I have this one, but it doesn't work.
How do i use the "public function getTorrents()" to get the array into a foreach loop?
I really appreciate your help
Code: Select all
public function getTorrents()WebUI API: http://pastebin.com/m76205d0b
I have this one, but it doesn't work.
Code: Select all
$utorrent = new uTorrent();
$utorrent->host = $_SESSION['host'];
$utorrent->user = $_SESSION["user"];
$utorrent->pass = $_SESSION["pass"];
$torrents = $utorrent->getTorrents();
foreach($torrents as $torrent) {
echo $torrent[UTORRENT_TORRENT_NAME]."\n";
}I really appreciate your help