+ 2
How can I bruteForce a number?
I wanted to upgrade my skillls in PHP by making a script that bruteForces a number, and the number should be from 0000000 to 9999999 and I don’t have any idea how I tried adding 1 to 0000000 to make the output 0000001 but it only outputs 1. can u suggest some ideas
3 Respuestas
+ 8
@Mario Laurisch
wow php looks clunky
+ 6
for($a=0; $a<=9; $a++) {
for($b=0; $b<=9; $b++) {
...
for($f=0; $f<=9; $f++) {
echo $a . $b . $c . ... . $f;
}}}}}}
hope that helps you to get the idea
+ 2
for ($I=0;$I<=999999;$I++) {
$paddedstr = str_pad($I, 7, '0', STR_PAD_LEFT);
if (somecheck($paddedstr) == true) {
return $paddedstr;
}
}