Jump to: navigation, search

Php quoted printable decode

From w3cyberlearnings

Contents

PHP function quoted_printable_decode

This function converts a quoted-printable string to an 8 bit string. Check out the ASCII List of ASCII values.

Syntax quoted_printable_decode

  • string: string input
quoted_printable_decode(string);

Example 1

<?php

$str="=20";
echo quoted_printable_decode($str);
?>

Output: print whitespace


Example 2

<?php

$str="=22Leader=22";
echo quoted_printable_decode($str);
?>

Output

"Leader"

Example 3

<?php

$str_ascii = '=30 =31 =32 =33 =34 =35 =36 =37 =38 =39 =3A =3B =3C =3D =3E =3F';
$arr_ascii = explode(' ', $str_ascii);

foreach ($arr_ascii as $ascii) {
	echo quoted_printable_decode($ascii);
	echo '<br/>';
}
?>

Output

0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?

Example 4

<?php

$str = "You are great =21 and I give you =31=30=30=30=24";
echo quoted_printable_decode($str);
?>

Output

You are great ! and I give you 1000$

Related Functions


Navigation
Web
SQL
MISC
References