I made PHP coding using an XML file, the source code of which I copied manually, it looks like
<title type='text'>content I've extracted</title> <content type='text'>content I've extracted</content>
Now everything is done, and when I generate content using PHP coding, and when I try to extract things from the headers and content tags, the result is not generated ... when I crossed, I found a PHP-generated file (source code, RSS feed) looks like
<title type=\'text\'>content to be extracted </title> <content type=\'text\'>content to be extracted</content>
As there are backslashes, it cannot extract the contents, I think
The sample PHP code that I use to retrieve the content from these tags is
$titles = $entry->getElementsByTagName( "title" ); $title = $titles->item(0)->nodeValue; $descrs = $entry->getElementsByTagName( "content" ); $descr = $descrs->item(0)->nodeValue;
Can someone please suggest me how I can proceed.
This is the PHP code I used to create the XML
$url='http://gdata.youtube.com/feeds/api/playlists/12345'; $fp = fopen($url, 'r'); $buffer=''; if ($fp) { while (!feof($fp)) $buffer .= fgets($fp, 1024); fclose($fp); file_put_contents('feed.xml', $buffer);
I found a solution
$buff=stripslashes($buffer); file_put_contents('ka.xml', $buff);
so the stripslashes() function removes the backslash and works