Page 1 of 1

Using CSV Files - Tutorial

Posted: Tue Apr 01, 2014 6:54 pm
by wulfgen
I found this tutorial concerning reading and write to a csv file ( a lot of talk on the web, but not much actual info ) Thats why I found this quite interesting and easy to follow

However, once followed exactly as described, I get to a point in the first video (9:28) where the course talks about exploding an array using in the csv.inc.php file:
    foreach (file($filename, FILE_IGNORE_NEW_LINES) as $line){
    $rows[] = str_getcsv($line);
    }
**If displayed I get an error:
undefined function str_getcsv() in ***my server path address to the csv.inc.php file.

Upon research I find that people are talking about fgetcsv() and other ways to explode the array

I know enough about PHP to make myself dangerous, and I'm finding no matter where I look I can't find a tutorial that comes near to this. I'm at a standstill right now.... what would be a fix for this

Using a phpinfo file, I'm using PHP Version 5.2.17 --

I would love to finish this, where do I go from here?? :) :|

Re: Using CSV Files - Tutorial

Posted: Sun Jun 28, 2015 8:12 pm
by Temor
This reply comes way late but for future reference:

str_getcsv is only available in PHP 5.3.0 or later. You need to update your PHP version to the latest one, which is a good idea regardless.