您的位置 首页 php

PHP手机和身份证号打码,生成随机数,判断逗号隔开的数字串等

/*1、判断 字符串 是否是逗号隔开的数字*/

function checkNumbericStrByComma($string = "") {
$pattern = "/^(\d+,)*(\d+)$/";
$ret = preg_match($pattern, $string);
return $ret;
}
 

/*2、手机号打码中间四位用*表示*/

function codeMobile($mobile = "") {
return preg_replace('/(^.*)\d{4}(\d{4})$/', '\\1****\\2', $mobile);
}
 

/*3、身份证号打码中间9-14位用*表示*/

function codeIdcard($idcard = "") {
return  strlen ($idcard) == 15 ? substr_replace($idcard, "******", 8, 6) : (strlen($idcard) == 18 ? substr_replace($idcard, "******", 8, 6) : "");
}
 

/**

* 4、生成随机数字符串

* @param string $type 类型 alpha/alnum/numeric/nozero/unique/ md5 /encrypt/sha1

* @param int $len 长度

* @return string

*/

function randomString($type = 'alnum', $len = 8) {
 switch  ($type) {
case 'alpha':
case 'alnum':
case 'numeric':
case 'nozero':
switch ($type) {
case 'alpha':
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
 break ;
case 'alnum':
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'numeric':
$pool = '0123456789';
break;
case 'nozero':
$pool = '123456789';
break;
}
return substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len);
case 'unique':
case 'md5':
return md5(uniqid(mt_rand()));
case 'encrypt':
case 'sha1':
return sha1(uniqid(mt_rand(), TRUE));
}
}

 

文章来源:智云一二三科技

文章标题:PHP手机和身份证号打码,生成随机数,判断逗号隔开的数字串等

文章地址:https://www.zhihuclub.com/77949.shtml

关于作者: 智云科技

热门文章

评论已关闭

32条评论

  1. com 20 E2 AD 90 20Pastilla 20Viagra 20Femenino 20 20Viagra 20Rezeptpflichtig 20Spanien viagra rezeptpflichtig spanien Two years ago the UK had a buffer between energy supply and demand of 16, but this winter that will fall to 5 and it could hit 2 by 2015, according to the National Grid and the energy regulator, Ofgem 86 British Leyland UK Ltd v Swift 1981 IRLR 91

  2. The drug is also important to the marketing strategy of Salt Lake City based Myriad Genetics mygn, a company that makes the only test for genes that can cause both breast and ovarian cancer

  3. Healthy reproductive system function May provide moderate relief of estrogen dominance symptoms May provide moderate relief of estrogen depletion symptoms Healthy functioning of the endocrine system, including the adrenals, thyroid, and pancreas Collagen production hair, skin, nails, muscles Potential increase of neurotransmitter hormone receptors on cells Bone and muscle repair 2017 Dec; 69 6 1380 1385

  4. link to original articlePubMed Update Meyer RM, Gospodarowicz MK, Connors JM, Pearcey RG, Wells WA, Winter JN, Horning SJ, Dar AR, Shustik C, Stewart DA, Crump M, Djurfeldt MS, Chen BE, Shepherd LE; NCIC Clinical Trials Group; ECOG

  5. POUILLART T eliglustat increases levels of chloroquine by affecting hepatic enzyme CYP2D6 metabolism

  6. crizotinib increases levels of etoposide by P glycoprotein MDR1 efflux transporter 0077 median PFS 11

  7. Perhaps bupropion wellbutrin is an mao inhibitors maois included 522 double- blind, therapist- assisted self- management techniques or oral doses from placebo

  8. Both companies ship internationally Publication bias was assessed by linear regression of standardized effect as a function of precision

  9. The low incidence of acute vasodilatory side effects, such as flushing and tachycardia, is because of the slow rate of rise of blood DHP levels

  10. Augments proliferation, differentiation and mineralization of osteoblastic MC3T3 EI cells and attenuates psychosine induced expression of proinflammatory cytokines and iNOS in astrocytes

  11. More recently, advances in immunohistochemistry and molecular biology have led to an appreciation of greater diversity within the spectrum of LN, and there is considerable speculation that the pleomorphic variant of LCIS will prove to have a different clinical behavior than the classical LCIS subtype

  12. A variety of potential pitfalls are detailed in Table 1, most of which do not require further investigation

  13. After 24 h 100 Ојg T4 is given intravenously, followed by 50 Ојg T4 daily from the third day until the patient regains consciousness

  14. Adults The usual initial dose of Furosemide Indo Farma for hypertension is 80 mg, usually divided into 40 mg twice a day

  15. Serious Use Alternative 1 atazanavir will increase the level or effect of modafinil by affecting hepatic intestinal enzyme CYP3A4 metabolism Some different advantages results worth referencing remember an expansion for endurance, decreased muscle harm, an increment in strong perseverance just as the security of slender muscle mass during the cutting stage

  16. Advise the patient about the possible occurrence of symptoms related to postural hypotension, such as dizziness, when taking tamsulosin hydrochloride capsules USP, and they should be cautioned about driving, operating machinery or performing hazardous tasks see Warnings and Precautions 5

  17. Sniezek PJ, Graham BS, Busch HB, Lederman ER, Lim ML, Poggemyer K, Kao A, Mizrahi M, Washabaugh G, Yakrus M, Winthrop K Rapidly growing mycobacterial infections after pedicures

  18. In addition, the custom database query produced moving average confidence intervals and short run prediction intervals for yet to be observed time periods

网站地图