关于PHP网站URL地址“加密”或转义的问题?

2025-03-25 04:44:20
推荐回答(2个)
回答1:

PHP 函数 strtr

$trans = array('1'=>'a', '2'=>'b', '3'=>'c', '4'=>'d', '5'=>'e', '6'=>'f', '7'=>'g', '8'=>'h', '9'=>'i', '0'=>'z');
$url = 'aa.com/ct-9326664726.html';
echo strtr($url, $trans);
// 输出 aa.com/ct-icbfffdgbf.html

回答2:

base64_encode()函数加密