Php implements the method of converting URLs to thunder resources ,. Php implements the method of converting URLs to thunder resources. This article describes how php implements the method of converting URLs to thunder resources. Share it with you for your reference. Php implements the method of converting URLs to thunder resources,
This example describes how php converts a url to a thunder resource. Share it with you for your reference. The specific method is analyzed as follows:
If you know the rules for generating the Thunder address, you will not feel how complicated the Thunder url resources are,
In fact, Ray's address is base64_encode encoding after AA is followed by BB in front of the original url.
Example:
The code is as follows:
<? Php
Function Thunder ($ url, $ type = 'en '){
$ Url = 'http: // www.bkjia.com ';
If ($ type = 'en '){
Return "thunder: //". base64_encode ("AA". $ url. "ZZ ");
} Else {
Return substr (base64_decode (substr (trim ($ url), 10), 2,-2 );
}
}
$ Url = 'http: // www.bkjia.com ';
Echo Thunder ($ url );
?>
Output result:
Thunder: // QUFodHRwOi8vd3d3LmpiNTEubmV0Wlo =
I hope this article will help you with php programming.
Example: This article describes how php Converts url to thunder resources. Share it with you for your reference ....