PHP Classes

Load CSV files problem

Recommend this page to a friend!

      PHP Email validation  >  All threads  >  Load CSV files problem  >  (Un) Subscribe thread alerts  
Subject:Load CSV files problem
Summary:Add __DIR__ to load CVS files
Messages:2
Author:Lionel F. Lebeau
Date:2016-03-20 16:14:49
 

  1. Load CSV files problem   Reply   Report abuse  
Picture of Lionel F. Lebeau Lionel F. Lebeau - 2016-03-20 16:14:49
In Function LoadCSVList($file, &$list)
I had to change
if(!($csv = fopen($file, "r")))
to
if(!($csv = fopen(__DIR__.'/'.$file, "r")))
because I put the folder in an other folder.
I didn't have this problem with previous versions.

  2. Re: Load CSV files problem   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2016-03-20 20:24:15 - In reply to message 1 from Lionel F. Lebeau
That function is called with the paths that you specify the the class variables for the CSV files to load. If you set those variables with the correct path that you want, it will work as you intend.