note 128477 added to function.explode

From: Date: Wed, 10 May 2023 12:45:53 +0000
Subject: note 128477 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-220432@lists.php.net to get a copy of this message
<?php $data="./logSkipass.txt"; $pass="00788"; if(getLiftLength($data,$pass)==-1) {exit("Datei nicht gefunden.");} echo "<p>Der Benutzer mit der PassID: ".$pass." hat insgesamt : " .getLiftLength($data,$pass)." m Liftstrecke benutzt</p>"; function getLiftLength ($dataname,$passID) :int { $LiftLength=0; if (!file_exists($dataname)) { return -1; } else { $fp=fopen($dataname,"r"); while(!feof($fp)) { $row=fgets($fp); $rowarray=explode("|",$row); //echo $rowarray[2]. " --> ".$rowarray[5]. "<br>"; if($rowarray[2]==$passID) { $LiftLength+=(int)$rowarray[5]; //Typecast } } fclose($fp); return $LiftLength; } } ?> ---- 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.explode.php Edit -- https://main.php.net/note/edit/128477 Del: integrated -- https://main.php.net/note/delete/128477/integrated Del: useless -- https://main.php.net/note/delete/128477/useless Del: bad code -- https://main.php.net/note/delete/128477/bad+code Del: spam -- https://main.php.net/note/delete/128477/spam Del: non-english -- https://main.php.net/note/delete/128477/non-english Del: in docs -- https://main.php.net/note/delete/128477/in+docs Del: other reasons-- https://main.php.net/note/delete/128477 Reject -- https://main.php.net/note/reject/128477 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#220432) next »