php正则匹配多个出现有关问题

WBOY
Release: 2016-06-13 12:01:07
Original
1576 people have browsed it

333"; $result = array();  preg_match("//",$str,&nbs" />

MyException - 代码迷
首页
  • Web开发
  • Android
  • J2EE
  • PHP
  • Linux/Unix
  • MySql
  • C#
  • 更多...
当前位置: 代码迷 » PHP » php正则匹配多个出现有关问题

php正则匹配多个出现有关问题

www.MyException.Cn,网友分享于:2014-06-30   浏览:0次
php正则匹配多个出现问题
<br />$str="<图片4>333<图片5>";<br /><br />$result = array(); <br />preg_match("/<图片(.*)>/",$str, $result); <br />return $result[1][0].$result[1][1].; <br /><br />
Copy after login

想输出4,5两个数字,但是.$result[1][1]会输出“>"
请教怎么样只会输出数字,不会输出”>"
------解决思路----------------------
preg_match("//",$str, $result); 
试试看看行不行
------解决思路----------------------
preg_match_all("//U",$str, $result); 
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template