网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 php+正则将字符串中的字母数字和中文分割
范文
    如:$str=php如何将字 符串中322的字母数字sf f45d和中文_分割?;按数字或字母分割。
    代码如下:
    $str = php如何将字 符串中322的字母数字asf f45d和中文_分割?;
    $arr = preg_split(/([a-za-z0-9]+)/, $str, 0, preg_split_no_empty | preg_split_delim_capture);
    print_r($arr);
    结果
    代码如下:
    $new = array();
    $new[0]=php;
    $new[1]=如何将字 符串中;
    $new[2]=322;
    $new[3]=的字母数字;
    $new[4]=sf;
    $new[5]= ;
    $new[6]=f45d;
    $new[7]=和中文_分割?;
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/21 12:26:24