note 128478 added to function.fopen

From: Date: Wed, 10 May 2023 12:47:34 +0000
Subject: note 128478 added to function.fopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-220433@lists.php.net to get a copy of this message
<?php /*------------------M A I N----------------------------*/ $data="logSkipass.txt"; $pass="08767"; echo "<p>Der Benutzer mit der PassID: ".$pass." hat insgesamt : ".getLiftLength($data,$pass)." m Liftstrecke benutzt</p>"; /* ---------------F U N C T I O N S--------------------*/ function getLiftLength($dataName,$passID):int { $liftLength=0; if(!file_exists($dataName)) { exit ("<p> Datei nicht gefunden </p>"); } else { $fp=fopen($dataName,"r"); while(!feof($fp)) { $row=fgets($fp); $rowArray=explode("|",$row); //var_dump($rowArray); //echo $rowArray[2]." --> ".$rowArray[5]."<br>"; if($rowArray[2]=$passID) { $liftLength=(int)$liftLength+(int)$rowArray[5]; //Typecast } } fclose($fp); return $liftLength; } } ?> ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.13.130 (proxied: 2a02:8071:886:7200:b566:992f:b83a:107d) ---- Manual Page -- https://php.net/manual/en/function.fopen.php Edit -- https://main.php.net/note/edit/128478 Del: integrated -- https://main.php.net/note/delete/128478/integrated Del: useless -- https://main.php.net/note/delete/128478/useless Del: bad code -- https://main.php.net/note/delete/128478/bad+code Del: spam -- https://main.php.net/note/delete/128478/spam Del: non-english -- https://main.php.net/note/delete/128478/non-english Del: in docs -- https://main.php.net/note/delete/128478/in+docs Del: other reasons-- https://main.php.net/note/delete/128478 Reject -- https://main.php.net/note/reject/128478 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#220433) next »