Using CSV Files - Tutorial

Post here is you are having problems with any of the tutorials.
Post Reply
wulfgen
Posts: 1
Joined: Tue Apr 01, 2014 5:53 pm

Using CSV Files - Tutorial

Post 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?? :) :|
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Using CSV Files - Tutorial

Post 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.
Post Reply