I am in the process of setting up a wordpress site to display a series of daily forecast plots. These plots are created by dygraps are updated everyday when I replace CSV files.
However on my WordPress page I want to have one line of text informing the reader when the posts were last updated. To do this I created an additional CSV file that was then uploaded to a directory. This 1 line file called “date.csv” looks like this:
I am trying to use php to read this csv and the print this line on a wordpress page by using the following:
$csv = str_getcsv(file_get_contents('http://development.irish-surge-forecast.ie/wp/Test_directory/Date.csv')); echo '<pre>'; print_r($csv); echo '</pre>';
However the output on the wordpress page looks like this:
 => )
Any ideas? Im not a PHP expert by any stretch, but would appreciate any feedback.
Read more here: Read CSV in WordPress using PHP