• 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

woocommerce get_order_report_data to show order_item_id

How to override htaccees file for cache control header

How can I make this nested location configuration use the correct path to call a php program?

WHERE IN array binding in DB::raw laravel 5.4

Split array into 4-element chunks then implode into strings

Get lat/lon from google maps url ftid (hex)

Invalid value in field "itemtype" in Google Search Console

Magento 2 - Controller returning blank page

PHP Array split string and Integers

Extract house numbers from address string

Laravel Passport - Not able to get token string in response?

get attribute from class not working php 7

how to redirect the user back to desired URL after login page in PHP?

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

Find out the name of the last script that included the current one

About Contact Privacy policy Terms and conditions