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);
} 

2 thought on “How to encode and decode Base64 in PHP”

Leave a Reply