php 获取图片base64编码格式数据

$image_file                = '1.jpg';

$image_info             = getimagesize($image_file);
$base64_image_content   = "data:{$image_info['mime']};base64," . chunk_split(base64_encode(file_get_contents($image_file)));

 

posted @ 2017-01-09 16:22  Tiac  阅读(6042)  评论(3编辑  收藏  举报