正文 329字数 170,814阅读

<?php $image_src = '/img/logo-zhidao.gif';//传递的参数 $image = array_pop(explode('/',$image_src)); //如果传递的不是URL 上两步可以不写 $image_type = array_pop(explode('.',$image)); header("Content-type:".$image_type);//注意类型 $filecontent = file_get_contents($image_src);//读取文件 echo $filecontent;//输出文件
Run code
Cut to clipboard