I have a code in javascript. I want to convert it in php. I don't know how to convert this: str.toString(CryptoJS.enc.Base64)
function base64URLEncode(str) {
return str.toString(CryptoJS.enc.Base64).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
}
Thank you so much.
So you want to decode base64 in PHP?
https://www.php.net/manual/de/function.base64-decode.php
And encoding of course: https://www.php.net/manual/de/function.base64-encode.php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.