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