php image 转 data uri 图片 (Image Data URIs with PHP)
<?phpfunction getDataURI($image, $mime = '') {
return 'data: '.($mime ? (function_exists('mime_content_type') ? mime_content_type($image) : $mime) : '').';base64,'.base64_encode(file_get_contents($image));
}
view demo
原文:http://davidwalsh.name/data-uri-php
页:
[1]