• 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

Nginx RTMP not recording

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Only on Firefox "Loading failed for the <script> with source"

How to Display Data in Yajra Datatables Laravel 7?

Currently Using CodeIgniter Framework i have an Error

Getting public posts of a random user from Facebook API

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

Using Associative arrays

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

unable to load your default controller on Codeigniter

How to assert parameter attribute sub-structures in PHPUnit mock call expectations

How to get an Array value inside an object in an array Php [duplicate]

Project structure for PHP

How to find the date a user created their Google account

Shortcode or PHP inside a shortcode in Wordpress

About Contact Privacy policy Terms and conditions