How to encode and decode Base64 in PHP

To encode and decode Base64 in PHP you can use the following snippet.

Sample PHP

function EncodeBase64($input) {
	return base64_encode($input);
}

function DecodeBase64($input) {
	return base64_decode($input);
} 

Please Share us:
Please rate this snippet

2 thoughts on “How to encode and decode Base64 in PHP

Leave a Reply