views:

48

answers:

1

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();

?>
+1  A: 

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); 
And if he must use quotes for also including text, use " " instead of ' ' or $var . ''
Citizen
Removing all quotes worked. Thanks!