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

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

WBOY
WBOYOriginal
2016-06-13 13:28:07965browse

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); 
Statement:
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