Created
May 21, 2018 10:04
-
-
Save phpfiddle/c1826004924625409be830316f141cef to your computer and use it in GitHub Desktop.
[ Posted by Biswa Bandhu Bhandary ] This code generates the below pattern if we set modulus divider value 3
i = 0;j = 0;
i = 1;j = 0;
i = 2;j = 0;
i = 3;j = 1;
i = 4;j = 1;
i = 5;j = 1;
i = 6;j = 2;
i = 7;j = 2; so on...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$i = 0; | |
$_SESSION['k'] = 0; | |
while ($i<1000){ | |
do_mail($i); | |
$i++; | |
} | |
function do_mail($i) { | |
$j = 0; | |
$k = $_SESSION['k']; | |
echo "i->".$i; | |
if ($i%500 === 0 && $i !== 0){ | |
$k += 1; | |
$_SESSION['k'] = $k; | |
} | |
$j = $i-($i-$k); | |
echo "j->".$j."</br>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment