PHP base64 Encode/Decode

by barkkathulla 2013-08-03 09:25:59

Simple way to encrypt and decrypt url in a safe manner:

Base64 is an encoding algorithm which is used to modify text contents and binary oriented streams into fixed scalable and easy-to handle form to be consumed by various programing as well as transmitted over the network.
Here is the step to encode and decode base 64 method....

<?php

function base64_url_encode($input)
{
return strtr(base64_encode($input), '+/=', '-_,');
}

function base64_url_decode($input)
{
return base64_decode(strtr($input, '-_,', '+/='));
}

?>

Tagged in:

749
like
0
dislike
0
mail
flag

You must LOGIN to add comments