• 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 web3 ERC20 token function call

"There is no active transaction" when refreshing database in Laravel 8.0 test

Message: Set sys_temp_dir in your php.ini after installed composer

How can I easily switch between PHP versions on Mac OSX?

Laravel lang slug in url

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

Laravel dosen't connect with Oracle

PHP7 CLI attempts to load xdebug twice - "Cannot load Xdebug - it was already loaded"

Merge column values from two arrays to form an indexed array of associative arrays

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Printing more than one array using print_r or any other function in php

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Error converting docx to pdf using Unoconv

auth pages not getting css in laravel

Show Custom Data in Woocommerce Order Details Admin Area

About Contact Privacy policy Terms and conditions