Hi,
I have a script that imports RSS feed data into it. The problem is what one of the feed sources has a url with an undefined variable in it (e.g. feed.aspx?id=4&name= ) . The face that the url ends with an equals sign is causing problems with my script. If I remove the “name=” from the url everything works fine.
So my question is how do I remove it?
I don’t know php but I was looked at a similar problem and the solution was to create a php file and link to the feed via the new php file. Eg. new_php_file.php?host=http://domain.com/feed.aspx
The code of the php file was as follows:
[php]<?php
// Configuration
$imagelocation = ‘http://www.domain.com’;
// End Configuration
$host = $_GET[‘host’];
$ch = curl_init($host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
echo preg_replace('/<img>(.*?)<\/img>/', '<img>'.$imagelocation.'$1</img>', $response);
?>[/php]
What this code did was to add “http://www.domain.com” to the url in the img tag.
How would I create a new code like this to remove &name= from a url in between
I would really appreciate any help anyone can give me.
Thank you