Home  >  Article  >  Backend Development  >  PHP url encryption and decryption function code_PHP tutorial

PHP url encryption and decryption function code_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:25:31753browse

Copy code The code is as follows:

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

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

//or

//Don’t know Why, the first decoding method above returns null, solution
$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 your requirements are not high.

If you want to be safe, then do it Use a special encryption class, hehe.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/324115.htmlTechArticleCopy code The code is as follows: $returnUrl = rawurlencode(base64_encode($returnUrl)); //Encoding $returnUrl = parse_str (base64_decode($returnUrl));//Decoding or $returnUrl = base64_deco...
Statement:
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