Home > php教程 > php手册 > php正则字符串中图片地址表达式

php正则字符串中图片地址表达式

WBOY
Release: 2016-06-13 10:03:56
Original
1149 people have browsed it

在字符串中要获取得我们想要的图片地址是一件很容易的事情,这是相对于会正则表达式的朋友来说哈,下面我们来参考一下。

 

 代码如下 复制代码
$str='

';
$pattern="//";
preg_match_all($pattern,$str,$match);print_r($match);
?>

结果显示:

 代码如下 复制代码

Array
(
    [0] => Array
        (
            [0] =>
        )

    [1] => Array
        (
            [0] => upfiles/2009/07/1246430143_1.jpg
        )

)

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template