This article mainly introduces the methods for restoring php base64-based decoded images and encrypted images, and describes the usage of the base64_decode function as an example, for more information about how to restore encrypted and base64-decoded php images, see the following example. Share it with you for your reference. The specific implementation method is as follows:
In this example, $ data is a base64 encoded image. The code is as follows:
The code is as follows:
<? Php
// File name: base64.php
$ Data = "/9j/4 users/users // users/j5 + users + Tl5ufo6ery8/T19vf4 + fr/2 gAMAwEAAhEDEQA/users // AJ/J/wDvs0AI2qX/APz + z/Jun/DQBE2sakOl/cf9/Jun/6CgBdK0q41QS/Jun/wnmmtudow.gbp/Jun/3B/Jun/9/Jun + BycJ/Jun + supervisor/mKAOdc0wPYbX/j1h/3F /lSA858RtjX7z/f/examples + examples/j1h/3F/examples/AG/examples/JAyaAE/tu/XTTp/samples/7i/yoA8w8UK // examples/55v8AkaAArJ/Examples /queues/lm/queues/LN/++ TQB7Zag/ZYeP4F/queues/880/75 FAB5Uf/PNP ++ RQAeVH/wA80/75FAB5Uf8AzzT/AL5FMA8qP/nmn/fIoAcBxSA // 9 k =";
$ Img = base64_decode ($ data );
Echo $ img;
?>
Image reference method:
The code is as follows:
Shows the running effect:
I hope this article will help you with PHP programming.