Last active
March 9, 2020 18:48
-
-
Save anmolio/5ac0dc8bca872b2a1e4536d0ac6ee13b to your computer and use it in GitHub Desktop.
PHP code to convert base 64 string to an image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$base64String = "R0lGODdhAQABAPAAAP8AAAAAACwAAAAAAQABAAACAkQBADs"; | |
$image = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '',$base64String)); | |
$FILE = time().rand(111111111, 999999999) . '.png'; | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment