0
点赞
收藏
分享

微信扫一扫

php image 转 data uri 图片 (Image Data URIs with PHP)

pipu 2023-05-12 阅读 66


<?php
function 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

举报

相关推荐

0 条评论