加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl中操作mysql,字符匹配与替换,字符串截取,计算字符长度

发布时间:2020-12-15 20:59:45 所属栏目:大数据 来源:网络整理
导读:?? ??? ??? ??? ??? ??? ??? ??? ??? ? ################################################################## ?? ??? ??? ??? ??? ??? ??? ??? ??? ? # shao.bing take off dial_prefix+prefix_dial from $CLphone_number ?? ??? ??? ??? ??? ??? ??? ??? ?
?? ??? ??? ??? ??? ??? ??? ??? ??? ? ################################################################## ?? ??? ??? ??? ??? ??? ??? ??? ??? ? # shao.bing take off dial_prefix+prefix_dial from $CLphone_number ?? ??? ??? ??? ??? ??? ??? ??? ??? ? ################################################################## ?? ??? ??? ??? ??? ??? ??? ??? ??? ?if ((length$CLphone_number) > 4) ?? ??? ??? ??? ??? ??? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $stmtA = "SELECT dial_prefix FROM vicidial_campaigns where campaign_id = '$CLcampaign_id';"; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $event_string =? __LINE__." ##########? $stmtA "; ?? ??? ??? ??? ??? ??? ??? ??? ????? &event_logger; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $sthA->execute or die "executing: $stmtA ",$dbhA->errstr; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $sthArows=$sthA->rows; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? if ($sthArows > 0) ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? { ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?@aryA = $sthA->fetchrow_array; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?$dial_prefix?? ?=?? ??? ??? ?$aryA[0]; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? } ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $sthA->finish(); ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??????????? $stmtA = "SELECT prefix_dial FROM system_settings ;"; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $sthArows=$sthA->rows; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? if ($sthArows > 0) ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? { ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?@aryA = $sthA->fetchrow_array; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?$prefix_dial?? ?=?? ??? ??? ?$aryA[0]; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?? } ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? $sthA->finish();?? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ?????????? if ((length$dial_prefix) != '0') ?? ??? ??? ??? ??? ?????????? { ?? ??? ??? ??? ??? ??? ??????????? if($CLphone_number=~ /[$dial_prefix]/) ?? ??? ??? ??? ??? ??? ??????????? { ?? ??? ??? ??? ??? ??? ?????????? ? ?? ??? ??? ??? ??? ??? ????????????? $CLphone_number = substr($CLphone_number,(length$dial_prefix),(length$CLphone_number) - (length$dial_prefix)); ?? ??? ??? ??? ??? ??? ?????????? ? ?? ??? ??? ??? ??? ??? ??????????? }?? ??? ??? ??? ??? ????????? ??? ? ?? ??? ??? ??? ??? ??????????? } ?? ?????????? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?if ((length$prefix_dial) != '0') ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?if($CLphone_number=~ /[$prefix_dial]/) ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?$CLphone_number = substr($CLphone_number,(length$prefix_dial),(length$CLphone_number) - (length$prefix_dial)); ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?} ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?} ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?if((length$CLphone_number)=='12' && substr($CLphone_number,2)=='01') ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?$CLphone_number = substr($CLphone_number,1,11); ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?} ?? ??? ??? ??? ??? ??? ??? ??? ??? ?}else { ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?$CLphone_number = $CLphone_number; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读