Base64 encode is used when binary data is shipped across a network, because some protocols may interpret data as control character or data can be corrupted when the protocol intepret data as special character combination. So, when data is transfered thru a protocol it's better if you encode data before transmiting and decode it after receiveing.
string base64_encode ( string $data );
$data - Data (String, Text etc) that needs to be encoded.
Returns encoded data.
Returns FALSE on failure.
$encode = 'Code Beautify';
Base64.encode64 ( data )
data - Data that needs to be encoded.
Returns base64 encoded data.
data = 'Code Beautify'
encoded_data = Base64.encode64(data)