Php parses base64 data to generate images,
This example describes how php parses base64 data to generate an image. We will share this with you for your reference. The details are as follows:
$ Base64 = "/9j/4 release/release + rZwumyxMjA/release/8 AAEQgAcgByAwEiAAIRAQMRAf/release/j5 + v/release + jp6vLz9PX29/j5 + /queue + queue/CPxoAbLJuOB0/queue + queue/jUaffX606b/WGgBlFFFAEkTZ + RuhpjDaxHpQn31 + tOm/queue + queue/rBTKfD/queue + queue/ 8 AdNJsb + signature/2Q = "; $ img = base64_decode ($ base64); // $ a = file_put_contents ('. /test.jpg ', $ img); // Save the image and return the number of bytes. // print_r ($ a); Header ("Content-type: image/jpeg "); // directly output jpg image echo $ img;
Run the following command:
PS: I would like to recommend several online image tools for your reference.
Online tools for converting images to Base64 encoding:
Http://tools.jb51.net/transcoding/img2base64
Online image format conversion (jpg/bmp/gif/png) tool:
Http://tools.jb51.net/aideddesign/picext
ICO icon generation tool:
Http://tools.jb51.net/aideddesign/ico_img