fork download
  1. <?php
  2. function getRandCode (){
  3. $str = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXXYZabcdefghijklmnopqrstuvwxyz';
  4. $code = "";
  5. for ($i = 0; $i < 10; $i ++) {
  6. $code .= $str{rand(0, 62)};
  7. }
  8. return $code;
  9. }
  10. $coderows = array();
  11. for ($k = 0; $k < 5; $k ++){
  12. $thecode = getRandCode();
  13. array_push($coderows,$thecode);
  14. }
  15. print_r($coderows);
Success #stdin #stdout 0s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 7uueFP2HCf
    [1] => qhrbcBMSoQ
    [2] => IYy8wiWC25
    [3] => l90fnG5qXI
    [4] => WOzN0cYM5O
)