PHP Classes

PHP Encoder: Encode and decode email with quoted-printable

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-06-02 (3 months ago) RSS 2.0 feedNot enough user ratingsTotal: 314 All time: 7,252 This week: 204Up
Version License PHP version Categories
php-encoder 0.1.7GNU General Publi...5.3Email, PHP 5, Text processing


This class can encode and decode email with quoted-printable.

It can take email message parts and encode them using either quoted-printable, base64, 8bit, 7bit and binary encodings.

The class can also do the opposite, i.e. decode previously encoded data with the same encodings.

Picture of Nathan Bishop
  Performance   Level  
Name: Nathan Bishop <contact>
Classes: 2 packages by
Country: Australia Australia
Age: 32
All time rank: 307237 in Australia Australia
Week rank: 402 Up4 in Australia Australia Up



Build Status

Table of Contents

<a name="about"></a>About

Encoder is a class that allows encoding/decoding from/to: - Base64 - Quoted Printable - 7bit (Future Feature) - 8bit (Future Feature) - Binary

<a name="getting-started"></a>Getting Started

  1. PHP 5.3.x is required
  2. Install manually

<a name="usage"></a>Usage

Include and instantiate:

require 'path\to\Encoder.php';

$encoder = new Encoder;

Convert text to base64:

$encoder->encode('Hëllo World!', $encoder::BASE_64); // returns 'SOtsbG8gV29ybGQh'

Convert text to quoted-printable:

$encoder->encode('Hëllo World!', $encoder::QUOTED_PRINTABLE); // returns 'H=EBllo World!'

Decode quoted-printable text:

$encoder->decode('=E1=E9=ED=F3=FA', $encoder::QUOTED_PRINTABLE); // returns 'áéíóú'

<a name="api"></a>API

Below is a list of the public methods available for use.

    encode($input, $scheme, $length = 75)   // Encode text to encoding scheme.
    decode($input, $scheme)                 // Decode text from encoded text.

<a name="testing"></a>Testing

This project keeps all tests stored in the /tests folder and uses the PHPUnit testing framework.

<a name="contributors"></a>Contributors

<a name="license"></a>License

(GNU General Public License, version 2)

Copyright &copy; 2013, Nathan Bishop

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see GNU General Public License, version 2.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Files folder imagetests (1 file)
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file Encoder.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file EncoderTest.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,252
This week:204Up
User Comments (1)
Thats a good class ;-)
9 years ago (Jos Filipe Lopes Santos)