Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make conversion of base64 to image using PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 270
    Comment on it

    Hello Reader's If you have some string in base64 and you need them to convert into image file, Then by using PHP you can do this as follows:-

    function base64Tojpeg($base64_string, $output_file) { $ifp = fopen($output_file, "wb");

    $data = explode(',', $base64String);
    
    fwrite($ifp, base64_decode($data[1])); 
    fclose($ifp); 
    
    return $output_file; 
    }

    Here now everytime string in base64 will get, function will return it into a jpeg file.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: