Home » PHP quoted_printable_decode() Function

PHP quoted_printable_decode() Function

by Online Tutorials Library

PHP String quoted_printable_decode() Function

The quoted_printable_decode() function is a built-in function of PHP, which converts a quoted-printable string to an 8-bit string. This function returns back an 8-bit binary string. The quoted_printable_decode() function is similar to the imap_qprint() function and opposite to the quoted_printable_encode() function. The syntax of this function is given below:

Syntax

Parameter

str (mandatory) – This function has only one string parameter as input which will be converted into an 8-bit string. It is a mandatory parameter.

Values Return

It returns the 8-bit binary string.

Supported PHP version

This function can be implemented by PHP 4+ versions

Example

There are some examples given below, which will help us to understand the quoted_printable_decode() function and it?s working in a better way.

Example 1

It will decode a quoted-printable string to an 8-bit ASCII string.

Browser Output:

The browser output of the following code will be:

Welcome to TutorAspire website.  

HTML Output:

The HTML output can be seen by right clicking on browser output in browser and select View page source. The HTML output for the following code will be:

PHP String quoted_printable_decode() Function

Example 2

Browser Output:

The browser output of the following code will be:

tutorAspire  

HTML Output:

PHP String quoted_printable_decode() Function

Note: The quoted_printable_decode() function is used in mail handling in PHP. Most of the times it contains quoted-printable such as =0A, 0D, etc. Therefore PHP provides the built-in functions to deal with such mails to generate plain 8-bit strings.

You may also like