赵国亮的博客

PHP JS LINUX 高性能网站开发

导航

js转16进制函数 php转16进制函数 加密 解密 js PHP交互 图片地址

 function EnBase64ThreeDes (s) {
   var r="";
   var w = new Array();
   var hexes = new Array ("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
   for (var i=0; i<s.length; i++)
   {
      r += hexes [s.charCodeAt(i) >> 4] + hexes [s.charCodeAt(i) & 0xf];
   }
   return r;
   //s是那串乱码r就是转换后的16进制字符串
   }

  

<?php
	include "functions.php";

	$key='caonima';
	$image_src = $_GET["url"];//传递的参数
	$image_src = vv_decode($image_src,$key);

	$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;//输出文件
?>

  

posted on 2013-06-21 09:57  赵国亮的博客  阅读(583)  评论(0编辑  收藏  举报

123