PHP URL encryption and decryption function

Source: Internet
Author: User
Tags php tutorial

PHP URL encryption and decryption function

Base64_encode Syntax: String base64_decode (string data);
*/

$str = ' d3d3ljexmwnulm5ldnk7vtu9zlpmzfg= '; Define String
echo Base64_decode ($STR); Www.111cn.net Cloud Community Network//Output decoded content/*

Base64_encode Syntax: String base64_encode (string data);
*/

$str = ' www.111cn.net cloud-Habitat Community Network '; Define String
echo Base64_encode ($STR); d3d3ljexmwnulm5ldnk7vtu9zlpmzfg=//Output encoded content

For more details please see: PHP tutorial Er/php-function/36589.htm ">http://www.111cn.net/phper/php-function/36589.htm


$RETURNURL = Rawurlencode (Base64_encode ($RETURNURL)); Coding

$RETURNURL = Parse_str (Base64_decode ($RETURNURL));//decode or
$RETURNURL = Base64_decode ($RETURNURL);//decoding

Or

Don't know why, the first decoding method above returns NULL, solving
$RETURNURL = Base64_encode ($RETURNURL); Coding
$RETURNURL = Base64_decode ($RETURNURL);//decoding


This is a way, but the safest, because as long as you know the principle can be solved, but your request is not high so that can be.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.