Use header image address in PHP to simply hide the image source address_PHP tutorial

WBOY
Release: 2016-07-21 15:52:28
Original
945 people have browsed it

Copy code The code is as follows:

$path=$_GET["path"]; 
$cacheimgname=str_replace("/","_",$path);   
$localimg="upimg/".$cacheimgname;   
if ((file_exists($localimg)))   >$httpurl=$localimg; 
} 
else 
{ 
$httpurl="http://www.imageserver.com/".$path; 
@copy($httpurl, $localimg);//Cache images!
}                                                                  >Copy code

The code is as follows:





http://www.bkjia.com/PHPjc/318905.htmlwww.bkjia.com
true

http: //www.bkjia.com/PHPjc/318905.html
TechArticle

Copy the code as follows: ?php $path=$_GET["path"]; $cacheimgname=str_replace(" /","_",$path); $localimg="upimg/".$cacheimgname; if((file_exists($localimg))) { $httpurl=$localimg;...

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