Home > Backend Development > PHP Tutorial > php 正则 提取视频地址,该怎么解决

php 正则 提取视频地址,该怎么解决

WBOY
Release: 2016-06-13 10:26:56
Original
825 people have browsed it

php 正则 提取视频地址
比如discuz论坛的视频输出:



我想利用正则从上面代码中提取出视频的宽,高,和地址
即上述代码中三个值:550、400、http://player.56.com/v_NTYwMzg0MjA.swf

请问如何写正则?请大家帮帮忙,本人对正则的确一点都不懂。。。。

------解决方案--------------------

PHP code
 preg_match("/.+'width',\s+'(\d+)',\s+'height',\s+'(\d+)'.+'src',\s+'([^\']+)'.+/i",$s,$m); print_r($m);<div class="clear">
                 
              
              
        
            </div>
Copy after login
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