让MySQL搜索区分大小写或排序时分大小写方法如下: 1.在SQL中强制 SELECT `field` FROM `table` WHERE BINARY…
August 20, 2015
PHP保存Base64图片 Convert Base64 string to an image file
The problem is that data:image/png;base64,
is included in the encoded contents. This will result in invalid image data when the base64 function decodes it. Remove that data in the function before decoding the string, like so.
function base64_to_jpeg($base64_string, $output_file) { $ifp = fopen($output_file, "wb"); $data = explode(',', $base64_string); fwrite($ifp, base64_decode($data[1])); fclose($ifp); return $output_file; }
转自:http://stackoverflow.com/a/15153931/4484798
本文:PHP保存Base64图片 Convert Base64 string to an image file