Home > Backend Development > PHP Tutorial > 求正则表达式

求正则表达式

WBOY
Release: 2016-06-23 13:10:08
Original
760 people have browsed it

用正则表达式获取字符串中http://到.jpg的,比如http://www.test.com/test.jpg、http://www.test.com/test2.jpg,获取图片路径


回复讨论(解决方案)

#http://.+?\.jpg#is

#http://.+?\.jpg#is


能说的详细点吗?我不会正则
字符串为$result,最后输出$image

preg_match_all('#http://.+?\.jpg#is', $result, $image);print_r($image);
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