PageRenderTime 42ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/jquery-validate/demo/captcha/rand.php

#
PHP | 11 lines | 4 code | 3 blank | 4 comment | 0 complexity | 64f4719ca5757ecf1604c2a165fa3814 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. <?php
  2. // Create a random string, leaving out 'o' to avoid confusion with '0'
  3. $char = strtoupper(substr(str_shuffle('abcdefghjkmnpqrstuvwxyz'), 0, 4));
  4. // Concatenate the random string onto the random numbers
  5. // The font 'Anorexia' doesn't have a character for '8', so the numbers will only go up to 7
  6. // '0' is left out to avoid confusion with 'O'
  7. $str = rand(1, 7) . rand(1, 7) . $char;
  8. ?>