开发者

Base64_encode for URLS

Is there a base64_encod开发者_JS百科e function that is URL safe in PHP?

It also needs to be decodable obviously.


urlencode(base64_encode($var));


No. There isn't one built-in.

You can simply do this,

$encoded = strtr(base64_encode($data), '+/=', '-_.');
$data = base64_decode(strtr($encoded, '-_.', '+/='));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜