title: Reading CSV file into javascript string or array
body: <p>I'm having a very specific problem so I hope someone can help. I'm building a map app with a CakePHP backend framework. I'm currently attempting to import some data into my application for manipulation, I have a google docs CSV file (i also have a local version) and I'm also using an custom js library. So i have a declaration that goes like so:</p>
  
  <p><code>mapbox.markers.layer().csv('csvstring');</code></p>
  
  <p>csvstring equates to a standard string of CSV data, i looked at some examples on the mapbox website but all had hardcoded data, e.g. <code>csvstring = 'lat,lon\n,0,0';</code></p>
  
  <p>Is there a simple way to read either the google doc, or read the file from my CakePHP directory, into a string variable or, failing that, an array? I've scoured the internet for days and haven't been able to find a solution. If its possible to let PHP do the dirty work and then pass the string to a js var then that would be great also. In the end it must be a string, or an array of strings. </p>
  
  <p>I've seen a lot of people recommending getting familiar with the Google Docs API, but really, I'm a nooby with both CakePHP and javascript and its taken a lot of work to get this far, my head is full to bursting point and I just dont think i'll be able for another big reading session, time is running out on my project. Also, dont assume I know ANYTHING, a complete idiots response would be greatly appreciated, thanks in advance.</p>