note 127222 added to function.fopen
| From: | Anonymous at main dot php dot net | Date: | Tue, 05 Jul 2022 19:28:21 +0000 |
| Subject: | note 127222 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-218898@lists.php.net to get a copy of this message | ||
<?php
$data="./logSkipass.txt";
$pass="28774";
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: 45.91.157.133 (proxied: 2003:cd:bf06:9700:e907:63c1:1f87:2883)
----
Manual Page -- https://php.net/manual/en/function.fopen.php
Edit -- https://main.php.net/note/edit/127222
Del: integrated -- https://main.php.net/note/delete/127222/integrated
Del: useless -- https://main.php.net/note/delete/127222/useless
Del: bad code -- https://main.php.net/note/delete/127222/bad+code
Del: spam -- https://main.php.net/note/delete/127222/spam
Del: non-english -- https://main.php.net/note/delete/127222/non-english
Del: in docs -- https://main.php.net/note/delete/127222/in+docs
Del: other reasons-- https://main.php.net/note/delete/127222
Reject -- https://main.php.net/note/reject/127222
Search -- https://main.php.net/manage/user-notes.php