Run PHP to pull google sheets CSV
<p>im working with the code below, it works in a regular php document but when i use it in wordpress it doesnt work. i have a plugin installed to allow me to run php code on pages. any help is appreciated.</p>

<pre><code>&lt;?PHP
function readCSV($csvFile){
    $file_handle = fopen($csvFile, 'r');
    while (!feof($file_handle) ) {
        $line_of_text[] = fgetcsv($file_handle, 1024);
    }
    fclose($file_handle);
    return $line_of_text;
}


// Set path to CSV file
$csvFile = 'https://docs.google.com/spreadsheets/d/1oC88LWXn4SgvVzK3wQAojXk7UM5tDjuWuMZDAjQTGjw/pub?gid=0&amp;single=true&amp;output=csv';

$csv = readCSV($csvFile);
echo '&lt;pre&gt;';
print_r($csv);
echo '&lt;/pre&gt;';
?&gt;
&lt;?php

print_r($csv[0][1]);//prints row 1, column 1

?&gt; &lt;?php

print_r($csv[0][2]);//prints row 1, column 1

?&gt;
</code></pre>