Home > php教程 > php手册 > PHP提取字符串中的图片地址[正则表达式]

PHP提取字符串中的图片地址[正则表达式]

WBOY
Release: 2016-06-06 20:39:16
Original
1503 people have browsed it

PHP提取字符串中的图片地址,实际就是利用正则表达式匹配图片地址,需要的朋友参考下。

代码如下:
$str='

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

结果显示:
Array
(
[0] => Array
(
[0] =>
)

[1] => Array
(
[0] => upfiles/2009/07/1246430143_1.jpg
)
)
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template