OK, I'm having a tough time figuring out replacements for fopen() and file() commands in some of my PHP files. In particular, this bit of code is giving me trouble:
$cdlistfilename = "http://mark.stubbornlights.org/cdlist/cdlist.csv";
$cddata = file($cdlistfilename);
$curl_handle = curl_init();
$cdlistfilename = 'http://mark.stubbornlights.org/cdlist/cdlist.csv';
curl_setopt ($curl_handle, CURLOPT_URL, $cdlistfilename);
curl_setopt($curl_handle, curlOPT_RETURNTRANSFER, 1);
$cddata = curl_exec($curl_handle);
What ends up happening is that it prints out the contents of the cdlist.csv file, which is not what I want. All I want to do is read the contents of the file into $cddata so that I can parse it and print it out to my liking (if you're curious, the page is a customized display of my cd list -- the csv file contains all of the information for each disk that I store in my excel spreadsheet, whereas the php file parses the file to only display important details like artist, title and record label).
Anyway, the php page is located here:
If anyone could suggest a way that I could read the file without having it automatically printed out like it's doing now, I'd appreciate it. Thanks.