Php-is there a problem with this code? Why doesn't my call function react?

Source: Internet
Author: User
Keywords Php
Php

function Genvericode ($type, $length =4, $clear =true) {
$nums =range (0,9); Array of numbers
$lower =range (' A ', ' Z '); Small Letter Array
$upper =range (' A ', ' Z '); Uppercase Array
$ignore =array (' 0 ', ' o ', ' o ', ' 1 ', ' l ', ' I ', ' 9 ', ' Q '); Hard-to-recognize character array

$chars=array();if($type==1)    $chars=$nums; // 只需要数字数组elseif($type==2)    $chars=array_merge($nums,$lower); // 数字+小写字母elseif($type==3)    $chars=array_merge($nums,$lower,$upper); // 数字+小写字母+大写字母if($clear)    $chars=array_diff($chars,$ignore); // 排除难辨认字符$keys=array_rand($chars,$length); // 随机取出length个字符,返回它们的key$code="";foreach($keys as $key)    $code.=$chars[$key]; // 通过key可以去$chars中找到具体的值,并在循环中拼接起来return $code;

}
Why did I call no response?

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.