I have made a script that generates an IMDB API link for a movie in XML.
Once this link is generated it will save to an XML file with its contents. The only issue is that the contents aren't saving.
Link generated:
http://imdbapi.org/?title=One+Piece&type=xml&plot=simple&mt=none&episode=0&aka=simple&release=simple
PHP script:
$url="http://imdbapi.org/?title=One+Piece&type=xml&plot=simple&mt=none&episode=0&aka=simple&release=simple";
$curl = curl_init();
$data = fopen("text.xml", "w");
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_FILE, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_exec ($curl);
if ( !$data ) {
echo "No";
} else {
$contents = curl_exec($curl);
fwrite($data, $contents);
}
curl_close($curl);
fclose($data);