Aera223

repeating-digits-script

Jul 8th, 2026 (edited)
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?php
  2. $test=6677337;
  3. for($i=($test+1);$i<($test+1000000);$i++){
  4. #Start loop assuming not unique
  5. $unique=false;
  6.  
  7. #true if unique digit
  8. foreach(count_chars((string)$i, 1) as $v){
  9. if($v==1){$unique=true;continue 2;}}
  10.  
  11. #if not unique
  12. if($unique===false){
  13. echo $i;break;}}
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment