Question

Within the code below, how do I set VAR as some variable and then include it within the SimplePie code as the feed URL? The "feed" code is from the Simplepie PHP libary.

<?php

$VAR = "http://website.com/feed/";

$feed1 = new SimplePie();
$feed1->set_feed_url('$VAR'); 
$feed1->init();

?>
Was it helpful?

Solution

I m not sure about Simple Pie. But if you use single quotes it wont be processed. Try double quotes or better you dont need any quotes for that. Try this :

$feed1->set_feed_url($VAR); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top