PHP开发技巧

日期:2020-07-09 浏览:56次

#电话号码切割
set @mobile := ‘18581066861’;
select concat(left(@mobile,3), ‘*****’, right(@mobile,4)) as mobile;

#一维数组入库,二维 value 需要循环拼接

$tmp = [];

$sql = "insert into table_name (" . join(',',array_keys($tmp)) . ') values (\'' . join('\',\'',$tmp) . '\')';
$r_attribute = $db->insert($sql,"last_insert_id");

 

没有评论

发表评论