downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<base64_decodeget_headers>
Last updated: Thu, 26 Jun 2008

base64_encode

(PHP 4, PHP 5)

base64_encode — Encodes data with MIME base64

Description

string base64_encode ( string $data )

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-encoded data takes about 33% more space than the original data.

Parameters

data

The data to encode.

Return Values

The encoded data, as a string.

Examples

Example #1 base64_encode() example

<?php
$str
= 'This is an encoded string';
echo
base64_encode($str);
?>

The above example will output:

VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==



add a noteadd a note User Contributed Notes
Encodes data with MIME base64
There are no user contributed notes for this page.




<base64_decodeget_headers>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs