Example 1 — Encode an Accented Word
A non-ASCII letter is turned into =XX codes.
<?php
$text = "Café";
echo quoted_printable_encode($text), PHP_EOL; How It Works
- Begin with UTF-8 text. The é uses two bytes.
- Call the function. Each special byte becomes =XX.
- Normal letters stay. Only é changes.
- Print the encoded string. You see Caf=C3=A9.

