";
echo "Requested URL: " . $url ."\n\n
\n\n";
$xml = simplexml_load_file($url);
// output raw starts
/*
print "";
print_r($xml->channel);
print "
";
echo "
";
*/
// output raw ends
foreach ($xml->channel->item as $movie) { // since exact query is not possible
$title=strip_tags($movie->title);
$subtitle=strip_tags($movie->subtitle);
$year = $movie->pubDate;
$dire = $movie->director;
$dire = "\"".str_replace("|", "\" \"", $dire)."\"";
$dire = str_replace("\"\"", "", $dire);
$actor = trim($movie->actor);
$actor = "\"".str_replace("|", "\" \"", $actor)."\"";
$actor = str_replace("\"\"", "", $actor);
$nRating = $movie->userRating;
$txt = $title."\t".$subtitle."\t".$year."\t".$dire."\t".$actor."\t".$nRating."\n";
$webtxt = "
*****
". $txt . "
*****
";
echo $webtxt;
fwrite($myfile, $txt);
$txt='';
// } else { }
}
}
fclose($myfile);
?>