base64_encode

string base64_encode(string data) 

Encodes data with base64 encoding.

Returns:

Base64-encoded string; FALSE if the argument passed has no length when converted to a string

Description:

base64_encode() encodes data using the Base64 algorithm and returns the encoded data.

Note:

Base64 encoding is used to encode data before it’s transferred across legacy email systems that only support 7-bit ASCII. For more information on base64, refer to RFC 2045.

Availability:

UNIX, Windows

Version:

3+, 4+

See also:

base64_decode() 

Example:

Use base64_encode() to create a simple MIME mail function
 function simple_mime_mail ($to, $subject, $message) { // Find out how many arguments were passed to the function $num_args = func_num_args (); // ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.