title: open csv in wordpress
body: <p>i have a csv file that contains some user specific data which i like to load into my template on the fly when a user access's their user area from the front end.</p>
  
  <p>the csv it self gets managed outside of wordpress and gets uploaded via ftp to a specific directory in the wordpress framework.</p>
  
  <p>as the csv itself contains all the data required, i didn't want to create additional processes where csv uploading to the database is necessary.</p>
  
  <p>i would like to call a function within my template to read the csv file and convert it to an array so i can just manipulate the data as i wish.</p>
  
  <p>i have attempted the following by inserting the following code into my template:</p>
  
  <pre><code>$file = fopen(get_option('siteurl') . '/wp-content/csv/userdata.csv',"r");
  
  while(! feof($file)){
    print_r(fgetcsv($file));
  }
  
  fclose($file);
  </code></pre>
  
  <p>However this doesn't seem to work and after searching online i cant seem to figure out why. Does WordPress support what i am trying to do? if not, then what can i do to achieve this functionality. i hope i don't have to do this outside of the WordPress framework and include it to my template via an iframe.</p>