- $www_Patch=$_SERVER['DOCUMENT_ROOT'];
- $filename = '/common/images/zzfw.png';
- $filepath = $www_Patch . $filename;
-
- $result = file_get_contents($filepath);
- $base64_image ="data:image/jpeg;base64,".base64_encode($result); //文件转base64
- return base64_decode($base64_image); //base64转文件
- return $base64_image;
- return $result;