Home  >  Article  >  Backend Development  >  php端怎么把ios POST过来的16进制图片 解析成图片

php端怎么把ios POST过来的16进制图片 解析成图片

WBOY
WBOYOriginal
2016-06-06 20:16:151431browse

求大牛解答,求大牛解答

回复内容:

求大牛解答,求大牛解答

$img = base64_decode($_POST['img']); //POST接受 base64 图片数据流 并解码

<code>    // 生成的文件名
    $file_dir  = "./public/".time().".png";  //文件需上传路径
    $res = file_put_contents($file_dir,$img);  //上传图片 并返回结果</code>
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