Hello, everyone,
I’m trying to open a CSV file using a CLI. Unfortunately I can’t do that. I want to save this file somewhere else afterwards. The error message:
Warning: fopen(Private/data/codes.csv): Failed to open stream: No such file or directory in C:
public function importCommand(): array
{
$result = [];
// Read into array
if (($handle = fopen('Private/data/codes.csv', "r")) !== FALSE) {
while (!feof($handle)) {
$row = fgets($handle) ;
if(str_contains($row, 'IW-')){
$result[] = $row;
}
}
fclose($handle);
}
return $result;
}
Thank you for a support
LG mark