I’m getting this error 3 times. Here’s the code:
<?php
$wageFile = fopen("wages1.txt","r"); // open the file containing employee wages
$wage1 = fgets($wageFile); // read the first wage from the file
$wage2 = fgets($wageFile); // read the second wage from the file
$wage3 = fgets($wageFile); // read the third wage from the file
fclose($wageFile);
$totalWages = $wage1 + $wage2 + $wage3;
$avgWage = $totalWages/3;
print("<p>Wage #1: $$wage1<br>");
print("Wage #2: $$wage2<br>");
print("Wage #3: $$wage3</p>");
print("<p>TOTAL WAGES PAID: $$totalWages</p>");
print("<p>AVERAGE WAGE: $$avgWage</p>");
?>
And my ouptut is:
WAGE REPORT
Notice : A non well formed numeric value encountered in D:\XAMPP\htdocs\webtech\coursework\chapter06\fixit1.php on line 28
Notice : A non well formed numeric value encountered in D:\XAMPP\htdocs\webtech\coursework\chapter06\fixit1.php on line 28
Notice : A non well formed numeric value encountered in D:\XAMPP\htdocs\webtech\coursework\chapter06\fixit1.php on line 28
Wage #1: $230.55
Wage #2: $450.65
Wage #3: $310.45
TOTAL WAGES PAID: $991.65
AVERAGE WAGE: $330.55
Line 28 is $totalWages = $wage1 + $wage2 + $wage3;
. Please help!