在php int上显示图像更改

时间:2012-06-24 22:49:20

标签: php json

在PHP中,当int从0变为1时,如何让它显示图像?我有;

$url = "forums.bukkit.org/alerts.json";
$page = file_get_contents($url);
$json_arr = json_decode($string,true);
return $json_arr['_visitor_alertsUnread'];

当json_arr为> 0时,如何让它显示图像?

1 个答案:

答案 0 :(得分:3)

if($json_arr['_visitor_alertsUnread'])
   echo "seen picture!";
else
   echo "not seen picture!";