Hey everyone. I am in the process of writing a PHP class that will parse RSS files. However, in the class constructor, I can't seem to get the filter_vars() function to work. Any suggestions (or see anything I messed up)?
The error I get is "PHP Fatal error: Call to undefined function filter_var() in /www/rss_feed.php on line 59"PHP Code:// Create the feed using the passed url
public function __construct ($in_url) {
if (filter_var($in_url, FILTER_VALIDATE_URL)) {
$this->feed = $in_url;
if ($xml = simplexml_load_file($in_url)) {
$this->readFeed($xml);
} else {
$this->status = 'Unable to open file <a href="$in_url">$in_url</a>';
}
} else {
$this->status = 'Invalid URL';
}
}
I know the filter_var method is supported, since I have an identical line in another class I have written.
Submit Your Article
Forum Rules

Reply With Quote