您可以使用image 属性中的 数据URI 进行此操作
src。
格式为:
data:[<MIME-type>][;charset="<encoding>"][;base64],<data>
这个例子直接来自维基百科页面上的数据URI:
<?phpfunction data_uri($file, $mime) { $contents = file_get_contents($file); $base64 = base64_enpre($contents); return ('data:' . $mime . ';base64,' . $base64);}?><img src="<?php echo data_uri('elephant.png','image/png'); ?>" alt="An elephant" />


