Home  >  Article  >  Backend Development  >  php保存canvas生成的图片

php保存canvas生成的图片

WBOY
WBOYOriginal
2016-06-23 13:07:391214browse

        //不做过多的解释,相信大家一看就能懂了。                $img      = $_POST['img'];        $img      = str_replace('data:image/png;base64,', '', $img);        $img      = str_replace(' ', '+', $img);        $data     = base64_decode($img);                $save_file = './uploads/'. uniqid().'.png';        $result = file_put_contents($save_file, $data);


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