Hi,
I am trying to read a CSV file with the Class 'File' but ran in some errors.
PHP Code:
$file = "test.csv";
$objFileCsv = new \CodeIgniter\Files\File($file);
echo $objFileCsv->getMTime();
$splFileCsv = $objFileCsv->openFile('r');
$splFileCsv->setFlags(SplFileObject::READ_CSV);
This i tryed in a helper without namespace and there is no problem. But in a Controller there is a error.
Quote:Class "App\Controllers\SplFileObject" not found
I didn't get it. I know its because the Namespace but SplFileInfo is a PHP build in Class and the Scope should be global or?
I also try
PHP Code:
namespace App\Controllers;
use SplFileInfo;
What i am missing?