• 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

wordpress : How to specify the cause "This site can’t be reached"

php script to delete files older than 24 hrs, deletes all files

How to execute sql code based on fetch array

Laravel Blade checkbox not checked

cakephp save drag and drop list order to database

Can't exclude directories from .htaccess mobile redirect?

Class AppHttpControllersUserController Does Not Exist

How to remove from a multidimensional array all duplicate elements including the original?

How to convert binary string to normal string in php

Laravel You requested 1 items, but there are only 0 items available

how to create html table in php

Unable to Edit config.inc.php

laravel 5.6 bulk inserting json data

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

Having trouble with PDO queries (Notice: Undefined index)

About Contact Privacy policy Terms and conditions