Home  >  Article  >  Backend Development  >  Use header image address in PHP to simply hide the image source address_PHP tutorial

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

WBOY
WBOYOriginal
2016-07-21 15:52:28904browse

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;...

Statement:
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