note 128499 added to function.fopen

From: Date: Wed, 10 May 2023 19:21:12 +0000
Subject: note 128499 added to function.fopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-220454@lists.php.net to get a copy of this message
<?php /*------------------M A I N----------------------------*/ $fid = 1111333355557; $km_davor = 4000; $st_davor = 800; $intervall_rate = holeInspStatus($fid, $km_davor, $st_davor); echo"<p>Das Fahrzeug mit der ID <strong>$fid</strong> hat <strong>$intervall_rate</strong> des Inspektionsintervalls erreicht!</p>"; /* ---------------F U N C T I O N S--------------------*/ function holeInspStatus($fid, $km_davor, $st_davor) { $file = "log.txt"; $km_neu = $km_davor; $st_neu = $st_davor; $km_intervall = 5000; $st_intervall = 1000; $fp = fopen($file, "r"); while(!feof($fp)) { $row = fgets($fp); $rowArray = explode("|",$row); $st_akt = $rowArray[3]; $km_akt = $rowArray[4]; if($rowArray[2] == $fid) { $km_neu += $km_akt; $st_neu += $st_akt; } } fclose($fp); $km_intervall_rate = ($km_neu/$km_intervall) * 100; $st_intervall_rate = ($st_neu/$st_intervall) * 100; if($km_intervall_rate >= $st_intervall_rate) return number_format($km_intervall_rate,2,',','.')."% (gef. km)"; return number_format($st_intervall_rate,2,',','.')."% (Lauf- zeit)"; } ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.13.130 (proxied: 2003:cd:bf0a:7200:a4db:5f3c:7d19:9615) ---- Manual Page -- https://php.net/manual/en/function.fopen.php Edit -- https://main.php.net/note/edit/128499 Del: integrated -- https://main.php.net/note/delete/128499/integrated Del: useless -- https://main.php.net/note/delete/128499/useless Del: bad code -- https://main.php.net/note/delete/128499/bad+code Del: spam -- https://main.php.net/note/delete/128499/spam Del: non-english -- https://main.php.net/note/delete/128499/non-english Del: in docs -- https://main.php.net/note/delete/128499/in+docs Del: other reasons-- https://main.php.net/note/delete/128499 Reject -- https://main.php.net/note/reject/128499 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#220454) next »