简体   繁体   中英

Convert base64URLEncode (in javascript) to php

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.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM