This snippet helps you to encode and decode your text with base64.
TW9oYW1lZCBTaGltcmFu
Replace Mohamed Shimran with the text you want to encode
Decoding
Base64 is a group of similar encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The Base64 term originates from a specific MIME content transfer encoding. - WikipediaEncoding
- <?php
- function Base64Encode($text){
- $base64_en = base64_encode($text);
- $base64_en = strtr($base64_en, '+/=', '-_,');
- return $base64_en;
- }
- echo Base64Encode("Mohamed Shimran");
- ?>
TW9oYW1lZCBTaGltcmFu
Replace Mohamed Shimran with the text you want to encode
Decoding
- <?php
- function Base64Decode($text){
- $base64_de = strtr($text, '-_,', '+/=');
- $base64_de = base64_decode($base64_de);
- return $base64_de;
- }
- echo Base64Decode("TW9oYW1lZCBTaGltcmFu");
- ?>
Return
Mohamed Shimran
Replace TW9oYW1lZCBTaGltcmFu with the encoded..
Post a Comment
Note: Only a member of this blog may post a comment.