• 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

Having trouble with PDO queries (Notice: Undefined index)

How can I make good efficent AJAX live forms with just jQuery and

Facebook PHP SDK - will not logout properly

XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page

How to redirect to another page and call a Function there on Angular ng-click

Use same method for inertia response and json response Laravel Jetstream

Valet, Xdebug after reboot Big Sur not working

Unable to create lockable file - Laravel 8 & PHP 8

How to downgrade or install a specific version of Composer?

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Split array into 4-element chunks then implode into strings

Laravel 8: Array to string conversion while calling route:list

MOODLE: What does it mean to aggregate h5p assets?

Check If array is null or not in php

Laravel passport auth token not working after moving to different server

About Contact Privacy policy Terms and conditions