<?php
//$file:图片地址
//Filetype: JPEG,PNG,GIF
$file = "encode.jpg";
if($fp = fopen($file,"rb", 0))
{
    $gambar = fread($fp,filesize($file));
    fclose($fp);

    $base64 = chunk_split(base64_encode($gambar));
    // 输出
    $encode = '<img src="data:image/jpg/png/gif;base64,' . $base64 .'" >';
    echo $encode;
}    
?>

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-10-05
  • 2021-08-30
  • 2022-01-07
  • 2021-11-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案