Home > Backend Development > PHP Tutorial > php怎么获取远程网站上的图片的地址?有什么思路吗?

php怎么获取远程网站上的图片的地址?有什么思路吗?

WBOY
Release: 2016-06-20 12:31:45
Original
1015 people have browsed it

php怎么获取远程网站上的图片的地址?有什么思路吗?
比如获取百度的背景图片的路径
https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/super/crop%3D229%2C229%2C1770%2C1103/sign=c9810c80b61c8701c2f9e8a61a4dac16/d1a20cf431adcbef91fbcc62a9af2edda2cc9f83.jpg


回复讨论(解决方案)

file_get_contents + preg_match_all ?

file_get_contents + preg_match_all ?


不会正则,怎么匹配图片jpg呢?

https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/super/crop%3D229%2C229%2C1770%2C1103/sign=c9810c80b61c8701c2f9e8a61a4dac16/d1a20cf431adcbef91fbcc62a9af2edda2cc9f83.jpg 
这个不就是吗?都知道了还用获取么

https://ss0.baidu.com/7Po3dSag_xI4khGko9WTAnF6hhy/super/crop%3D229%2C229%2C1770%2C1103/sign=c9810c80b61c8701c2f9e8a61a4dac16/d1a20cf431adcbef91fbcc62a9af2edda2cc9f83.jpg 
这个不就是吗?都知道了还用获取么


我只是举个百度的例子,给某个网址,然后获取这个网址里的图片

参考: http://www.jb51.net/article/51715.htm

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