• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

PHP: How to solve ob_start() in combination imagepng() issue?

phpoutput-buffering


PHP Snippet 1:

imagepng($imgSignature, 'php://memory/file.png');
$base64Signature = base64_encode(file_get_contents('php://memory/file.png'));

PHP Snippet 2:

ob_start();
imagepng($imgSignature);
imagedestroy($imgSignature);
$data = ob_get_contents();
ob_end_clean();
$data = base64_encode($data);

Related Snippets

PHP: PDO + CSV export not downloading (headers issue?)

add_action() function in wordpress not working [duplicate]

protect my blog content

Substitute integers and dots with regex [duplicate]

how to use extended ASCII instead of unicode in PHP

Cannot pass null argument when using type hinting

Converting array to string and then back in PHP

How to disable only_full_group_by option in Laravel

how to pass row id in href of a tag in codeigniter controller?

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

getting error while enter Command => php artisan route:list

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

What is my SQL missing?

How to properly start Laravel 8 with Bootstrap & authentication

Implode columnar values between two arrays into a flat array of concatenated strings

About Contact Privacy policy Terms and conditions