Encodes the given data with base64. This encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean, such as mail bodies.

Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding.
[ Wikipedia - PHP.net base64_decode - PHP.net base64_encode ]

Code
$str = 'test';
$base64 = base64_encode($str);
> dGVzdA==

$str = base64_decode($base64);
> test