• 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

How to test laravel controller method?

Laravel multi auth - Authentication user provider [] is not defined

How to get rid of ampersand using WP Nonce URL and WP Redirect or PHP header

Laravel insert dynamic input values with radio button

php curl_exec() Connection refused when retrieving a remote image

How to remove index.php and index from the URL using htaccess | PHP

PHP Imap , php 7.4.3 on mac osx catalina

Cut an arabic string

Convert PHP array into HTML tag attributes separated by spaces

How can I access an array/object?

How to find the date a user created their Google account

How to fix Call to undefined method AppModelsTableName::factory?

Laravel Nova, route not found

Converting IPv6 to IPv4 address in PHP

PHP only Hit Counter?

About Contact Privacy policy Terms and conditions