How to put IF THEN expression in PHP function fwrite
? The below-given code does not work correctly. Please look at the line fwrite($fh, "$row[0]...)
.
$myFile = "testFile.php";
$fh = fopen($myFile, w ) or die("can t open file");
fwrite($fh, "lat lon title description iconOffset icon
");
foreach ($result4 as $row):
fwrite($fh, "$row[0] $row[1] $row[2] Resource average speed is: $row[3] km/h -10,-10 if($row[4]==0) images/markerRed.png else images/markerGreen.png
");
endforeach;
fclose($fh);
?>