Código PHP:
<?php
$playerid = $_GET['playerid'];
// Set up variables //
$clanid='22572';
$playerstatus = '';
$item = '';
$img = '';
$playerid2= 0;
global $user_id;
$xml = file_get_contents("http://battletracker.com/clanfeed/aa3/18046/claninfo.xml");
include 'xml_regex.php';
$item_set = element_set('PLAYER', $xml);
foreach ($item_set as $item)
{
$img = 'x';
$playerid2 = value_in('PLAYERID', $item);
$playername = value_in('PLAYERNAME', $item);
$playerstatus = value_in('PLAYERSTATUS', $item);
if ($playerid2==$playerid)
{
if($playerstatus=="1") $statuspic="ponline.gif";
else $statuspic="poffline.gif";
// Create a new image instance
$im = imagecreatetruecolor(100, 100);
$im = @imagecreatefromgif($statuspic);
// Output the image to browser
header('Content-type: image/gif');
imagegif($im);
imagedestroy($im);
}
}
?>
Warning: Invalid argument supplied for foreach() in ...../trackerefs/trackericon.php on line 21
La linea 21 es la que pertenece a: foreach ($item_set as $item)
¿Alguna idea de como solucionar el error?
Un saludo y gracias!