求一个php正则表达
字符串如下。
hphm=AB198B*hpzl=01*fdjh=6111*
我想获得=和*之间值。。(即AB198B,01和6111)。
求preg_match_all的写法。
最好说明一下,谢谢。
------解决方案--------------------
$<a style="color:#f60; text-decoration:underline;" title="html" href="https://www.php.cn/zt/15763.html" target="_blank">html</a>="hphm=AB198B*hpzl=01*fdjh=6128*";
preg_match_all('/=([^*]*)\*/U',$html,$arr);
print_r($arr[1]);
<br><font color="#e78608">------解决方案--------------------</font><br>哪里不明白?
<br><font color="#e78608">------解决方案--------------------</font><br>[]里面表示非* 外面的*表示匹配0次或多次。 <br><div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号