Home > Backend Development > PHP Tutorial > PHP url encryption and decryption function_PHP tutorial

PHP url encryption and decryption function_PHP tutorial

WBOY
Release: 2016-07-13 17:09:55
Original
1079 people have browsed it

PHP url encryption and decryption function

base64_encode syntax: string base64_decode(string data);
*/

$str='d3d3ljexmwnulm5ldnk7vtu9zlpmzfg='; //Define string
echo base64_decode($str); //www.bKjia.c0myijututorial.com //Output the decoded content/*

base64_encode syntax: string base64_encode(string data);
*/

$str='www.bKjia.c0myijututorial.com'; //Define string
echo base64_encode($str); // d3d3ljexmwnulm5ldnk7vtu9zlpmzfg=                // Output the encoded content

For more details, please check: php tutorialer/php-function/36589.htm">http://www.bKjia.c0m/phper/php-function/36589.htm


$returnUrl = rawurlencode(base64_encode($returnUrl)); //Encoding

$returnUrl = parse_str(base64_decode($returnUrl));//Decoding or
$returnUrl = base64_decode($returnUrl);//Decoding

//or

//I don’t know why, the first decoding method above returns null, please solve
$returnUrl = base64_encode($returnUrl); //Encoding
$returnUrl = base64_decode($returnUrl);//Decoding


This is a way, but it is the safest, because as long as you know this principle, you can solve it, but if your requirements are not high, then it will be fine.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629704.htmlTechArticlePHP url encryption and decryption function base64_encode syntax: string base64_decode(string data); */ $str='d3d3ljexmwnulm5ldnk7vtu9zlpmzfg=' ; //Define string echo base64_decode($str); //www.111...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template