12345678910111213141516 |
- <?php
- function Qiniu_Encode($str) // URLSafeBase64Encode
- {
- $find = array('+', '/');
- $replace = array('-', '_');
- return str_replace($find, $replace, base64_encode($str));
- }
- function Qiniu_Decode($str)
- {
- $find = array('-', '_');
- $replace = array('+', '/');
- return base64_decode(str_replace($find, $replace, $str));
- }
|