I seem to be in a catch-22 with a small app I’m developing in PHP on Google App Engine using Quercus;
- I have a remote csv-file which I can download & store in a string
- To parse that string I’d ideally use str_getcsv, but Quercus doesn’t have that function yet
- Quercus does seem to know fgetcsv, but that function expects a file handle which I don’t have (and I can’t make a new one as GAE doesn’t allow files to be created)
Anyone got an idea of how to solve this without having to dismiss the built-in PHP csv-parser functions and write my own parser instead?
I think the simplest solution really is to write your own parser . it’s a piece of cake anyway and will get you to learn more regex- it makes no sense that there is no csv string to array parser in PHP so it’s totally justified to write your own. Just make sure it’s not too slow 😉