First of all create the base64 string
function encode_img($img)
{
$fd = fopen ($img, 'rb');
$size=filesize ($img);
$cont = fread ($fd, $size);
fclose ($fd);
$encimg = base64_encode($cont);
return $encimg;
}
$image_base64=encode_img('123.jpg'); // to encode the image
then convert back to image into some location
$img = imagecreatefromstring(base64_decode($image_base64));
if($img != false)
{
imagejpeg($img, 'user_images/image.jpg');
}
Have Dream Day
thankuuuuuuuuuuuuuuuuuuuuuuuuuuuu...............sooooooooooooo...............mucccccchhhhhhhhhhh
ReplyDeleteThis comment has been removed by the author.
ReplyDeletenice post! here is an online tool
ReplyDeletehttp://freeonlinetools24.com/base64-image