12 2014 档案
摘要:类似于.net的out功能,php中可以使用&实现如下示例:<?php$x=2;inOutFunction($x);function inOutFunction(&$x){ $x=3; return 'a';}echo $x;exit();同样,在递归中可以使用此方法传值:如下示例遍历文...
阅读全文
摘要:$tel='要验证的联系电话'; $isMob="/^1[3-5,8]{1}[0-9]{9}$/"; $isTel="/^([0-9]{3,4}-)?[0-9]{7,8}$/"; if(!preg_match($isMob,$tel) && !preg_match($isTel,$tel)) { e
阅读全文
摘要:批量修改数据库中的字段为随机数时Mysql中的写法:update `t` set col=FLOOR(RAND()*50+1)--取1-50的随机数Sqlsever中的写法:update t set col=ABS(CHECKSUM(NEWID()))%50+1 --取1-50的随机数Sqlseve...
阅读全文