I am using simplepie 1.5 and fetching multiple feed urls
$feed->set_feed_url(array('x','y','z'));
How can I load the feed URLs from my database table?
Attaching the code used.
$results = mysqli_query($link, "SELECT * FROM source_list");
$source;
$source_data;
while ($row = mysqli_fetch_array($results)) {
foreach($row as $key => $value ) {
if($key==='source_name'){
$source=$value;
}
}
$source_data= $source_data."'".$source."'".',';
}
$feed = new SimplePie();
$source_data= substr($source_data, 0, -1);
echo($source_data);
$url=array($source_data);
$feed->set_feed_url($url);
Try this code:
Like in your first code example we're setting an array of URLs to fetch (
$feedurls). You can uncommentvar_dump($feedurls);to check if the array contains the desired URLs from your database.