item_exists

(ReachRSS >= 0.91)
item_exists -- Checks if the specified item exists in the specified channel or not

Description

boolean item_exists ( string channel_url , string item_id )

This function checks if the item_id you specified exists in the specified channel and returns true if it is, false if it isn't. If the channel_url you specify is not subscribed to, item_exists() will return false.

Example 1. item_exists() example

$ReachRSS = new ReachRSS();
$ReachRSS->Startup();
$ReachRSS->add_channel("http://www.comicalert.com/public/popular24.xml");
$Exists = $ReachRSS->item_exists(
                       "http://www.comicalert.com/public/popular24.xml",
                       "bad_item_id"
                     );
if ($Exists) print "It exists!"; else print "It doesn't exist."

This example will subscribe ReachRSS to the "most popular comics" feed at Comic Alert! and then check to see if the item ID "bad_item_id" exists in that feed (which it probably won't).

See also item_ids(), item_property(), channel_exists()

Back to Function List

 

Home | Features | Samples | Demo | Download | Register | Help / Support