2

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.

vannguyen
  • 356
  • 2
  • 6
  • 20

1 Answers1

0

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

intxcc
  • 75
  • 7