This article introduced about the use of PHP Ase64_encode and UrlEncode to the string for simple encryption, is also a more common method, the need for students to refer to this article Oh.
Base64_decode
Decodes the BASE64 encoded string.
Syntax: String Base64_decode (string encoded_data);
return value: String
Function type: Encoding processing
Content Description
This function is decoded as a MIME BASE64 encoded string. The decoded string may be a Chinese string or other binary data.
Cases
| The code is as follows |
Copy Code |
$str = ' vghpcybpcybhbiblbmnvzgvkihn0cmluzw== ';
echo Base64_decode ($STR);
?> |
Str UrlEncode ($string)
This feature is handy for encoding strings when you want to pass variables to the next page as part of the URL's query as a convenient method.
I wrote this simple function to create a Get query URL () from an array:
| The code is as follows |
Copy Code |
$query _string = ' foo= '. UrlEncode ($foo). ' &bar= '. UrlEncode ($bar);
Echo ';
?> |
Look at a two comprehensive function.
| The code is as follows |
Copy Code |
$encryption = "username";
echo Base64_encode ($encryption);//echo "dxnlcm5hbwu=";
echo "
";
echo UrlEncode ("http://". $encryption);//echo "Http%3a%2f%2fusername";
echo "
";
Echo SHA1 ($encryption);//echo "249ba36000029bbe97499c03db5a9001f6b734ec"
echo "
";
?> |
http://www.bkjia.com/PHPjc/629677.html www.bkjia.com true http://www.bkjia.com/PHPjc/629677.html techarticle This article introduces the use of PHP Ase64_encode and UrlEncode to the string for simple encryption, is also a more common method, there is a need for students to refer to this article Oh ...