• PHP Video Tutorials

PHP - base64_encode() Function



base64_encode() function can encode the data with MIME base64.

Syntax

string base64_encode( string $data )

base64_encode() function can encode 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-encoded data can take about 33% more space than original data.

base64_encode() function can return the encoded data as string, or false on failure.

Example

<?php
   $str = "This is an encoded string";
   echo base64_encode($str);
?>
php_function_reference.htm
Advertisements