• 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

MongoDB Duplicate Documents even after adding unique key

How to average columns of data from multiple, flat arrays?

Magento 2 - How to add new block to admin panel in product page?

how to pass row id in href of a tag in codeigniter controller?

VB.NET WebRequest with PHP POST

php file upload scanning using clamav, permissions on /tmp/

How to pass data to all views in Laravel 5?

sort() not affecting original array while inside foreach loop

Check if string contains a value in array [duplicate]

How to render html from a @foreach loop in a textarea

How to give apache permission to write to home directory?

Composer fails with kylekatarnls/update-helper on new homestead

possible options to create pdf file using html elements to generate invoice in php and codeigniter

How to display MySQL table using php and edit it in a web browser

PHPS source file - 403 Forbidden You don't have permission to access this resource

About Contact Privacy policy Terms and conditions