变成
或
变成
或
变成
三处必须:
qlist:后边的 m或m2 是可能会变的 这里要保持替换前后一致
listname="xxx" 就是上方冒号后的内容 必须存在
中间的其他部分 是多种多样的 需要把格式 $aaa=bbb 全转成 aaa="bbb" 格式 有就转 没有就算 允许不填
$s = '<qlist:m $Row=10 $table=Channel $Where=[FatherID]=0 ><qlist:m2 $Row=10 ><qlist:m3>';echo preg_replace( array('/<qlist:(\w+)/', '/(\$Row=)(\d+)/'), array('$0 listname="$1"', '$1"$2"'), $s);<qlist:m listname="m" $Row="10" $table=Channel $Where=[FatherID]=0 ><qlist:m2 listname="m2" $Row="10" ><qlist:m3 listname="m3">
$s = '<qlist:m $Row=10 $table=Channel $Where=[FatherID]=0 ><qlist:m2 $Row=10 ><qlist:m3>';echo preg_replace( array('/<qlist:(\w+)/', '/(\$Row=)(\d+)/'), array('$0 listname="$1"', '$1"$2"'), $s);<qlist:m listname="m" $Row="10" $table=Channel $Where=[FatherID]=0 ><qlist:m2 listname="m2" $Row="10" ><qlist:m3 listname="m3">
<?php$s = '<qlist:m $Row=10 $table=Channel $Where=[FatherID]=0 ><qlist:m2 $Row=10 ><qlist:m3>'; echo preg_replace( array('/<qlist:(\w+)/', '/\$(Row=)(\d+)/', '/\$(table=)(\w+)/','/\$(Where=)(\[(\w+)\]=)(\d+)/'), array('$0 listname="$1"', '$1"$2"', '$1"$2"', '$1"$2$4"'), $s);?>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号