Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. <?php
  2. ## GNU Public Licence. Created by Børge Wennberg 2011
  3.  
  4. ## I know this is a hard way of doing it, but I wanted to check the string line before stripping the numbers.
  5.  
  6. $rawline = mt_rand(10000,100000) * mt_rand(1000,1000000);
  7. $rawlenght = strlen($rawline);
  8.  
  9.     if($rawlenght > 9) {
  10.         echo '<br>';
  11.         $search = array('2', '3', '4', '5', '6', '7', '8', '9');
  12.         $replace = array('0', '1', '1', '0', '0', '1', '0', '0', '1');
  13.         $newline = str_replace($search, $replace, $rawline);
  14.         echo $newline;
  15.         $newlineLen = strlen($newline);
  16.     }
  17.     else {
  18.         echo '<br>String not generated.';
  19.     }
  20.  
  21.  
  22.  
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement