PHP code example of ogbitblt / output

1. Go to this page and download the library: Download ogbitblt/output library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ogbitblt / output example snippets


use OGBitBlt\Output\OutputCompressionType;
use OGBitBlt\Output\OutputEncodingType;
use OGBitBlt\Output\OutputFactory;
use OGBitBlt\Output\TextFile;

// alternatively you can also:
// $outfile = new TextFile("somefile.txt");
$outfile = OutputFactory::Create(TextFile::class,['file' => "somefile.txt"]);
$outfile->Write("string without a newline character");
$outfile->WriteLn("string with a newline character");

// change encoding to base64
$outfile->Write("this is base64 encoded",['encoding' => OutputEncodingType::Base64]);

// gzip output 
$outfile->Write("this is gzipped",['compression' => OutputCompressionType::Gzip]);