note 128521 added to control-structures.while
| From: | anonymous at main dot php dot net | Date: | Thu, 11 May 2023 05:19:38 +0000 |
| Subject: | note 128521 added to control-structures.while | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220476@lists.php.net to get a copy of this message | ||
<?php
$fobiNr = 1234500;
echo getPruefziffer($fobiNr);
function getPruefziffer($fobiNr)
{
$pruefziffer = 0;
$gewichtung = 2;
$summe = 0;
while($fobiNr > 0)
{
$ziffer = $fobiNr % 10;
$summe = $summe + $ziffer * $gewichtung;
$fobiNr = $fobiNr / 10;
$gewichtung = $gewichtung + 1;
}
$pruefziffer = 11 - ($summe % 11);
if($pruefziffer == 10 || $pruefziffer == 11)
{
$pruefziffer = 0;
}
return $pruefziffer;
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 91.89.113.224)
----
Manual Page -- https://php.net/manual/en/control-structures.while.php
Edit -- https://main.php.net/note/edit/128521
Del: integrated -- https://main.php.net/note/delete/128521/integrated
Del: useless -- https://main.php.net/note/delete/128521/useless
Del: bad code -- https://main.php.net/note/delete/128521/bad+code
Del: spam -- https://main.php.net/note/delete/128521/spam
Del: non-english -- https://main.php.net/note/delete/128521/non-english
Del: in docs -- https://main.php.net/note/delete/128521/in+docs
Del: other reasons-- https://main.php.net/note/delete/128521
Reject -- https://main.php.net/note/reject/128521
Search -- https://main.php.net/manage/user-notes.php