1
I am trying to take 3 different values from 3 distinct csv file and multiply them, but it is giving this error. Where did I go wrong? Or what’s left to add?!
Error:
Notice: A non well Formed Numeric value encountered in C: xampp htdocs Accessing CSV fgetcsv.php files on line 34
Notice: A non well Formed Numeric value encountered in C: xampp htdocs Accessing CSV fgetcsv.php files on line 34
Code:
<?php
$file1 = __DIR__ . '/Trabalhos.csv';
$csv1 = file($file1);
foreach ($csv1 as $row1 => $line1) {
$row1++;
$column1 = str_getcsv($line1, ';');
if ($row1 == 2) {
echo $column1[6]."<br>";
$valor1 = $column1[6];
}
}
$file2 = __DIR__ . '/produtividade do trabalho.csv';
$csv2 = file($file2);
foreach ($csv2 as $row2 => $line2) {
$row2++;
$column2 = str_getcsv($line2, ';');
if ($row2 == 2) {
echo $column2[9]."<br>";
$valor2 = $column2[9];
}
}
$file3 = __DIR__ . '/inatividade do trabalho.csv';
$csv3 = file($file3);
foreach ($csv3 as $row3 => $line3) {
$row3++;
$column3 = str_getcsv($line3, ';');
if ($row3 == 2) {
echo $column3[0]."<br>";
$valor3 = $column3[0];
}
}
$total = $valor1 * $valor2 * $valor3
?>
Copy error instead of posting photo.
– Guilherme Nascimento
Excuse me. I’ll put.
– Alex_Alex_Alex
I tested your PHP and this perfect, the problem is in CSV.
– Guilherme Nascimento