Encode64 can obtain the shortest 26 English-size alphanumeric plus "-_" two symbols encoded data, the string can be transmitted freely in the network, without regard to the confusion caused by automatic transcoding. Cons: For large strings too slow, the reason is unclear, maybe the php script itself is slow, so it built a lot of functions, these functions if the implementation of the script is intolerable. And JavaScript doesn't have this problem, the script is much faster
The first step, first download the PHP Encode64 Encoding class Library We need: http://www.php.cn/xiazai/leiku/806
The second step, download the completion of the required PHP class files, unzip the value of the local directory, create a new PHP file ~
The third step, in the new file, we want to call this class, and instantiate this class:
<?phpinclude_once "code64.php"; Introduce class file $obj = new Encode64; Instantiate this class of $str = " //define variable echo $obj->code ($STR); Output?>
Run this file and get the results as shown:
Attention:
In this case, we just use one of the classes as a guide, the rest of the examples of small partners can do their own try!