- json_decode: documentation ( source)
- base64_decode: documentation ( source)
- strtr: documentation ( source)
<?php
function base64u_decode($data) {
return base64_decode(strtr($data, '-_', '+/'));
}
$clientData = "eyJ0eXAiOiJuYXZpZ2F0b3IuaWQuZ2V0QXNzZXJ0aW9uIiwiY2hhbGxlbmdlIjoiUklZdzh5SXAtUEJPalU1XzJGdmNrVVUydjJBT2lUTzAwN2dHWjhSeFItSSIsIm9yaWdpbiI6Imh0dHBzOi8vbG9jYWxob3N0IiwiY2lkX3B1YmtleSI6IiJ9";
$decodedClient = (String) json_decode(base64u_decode($clientData));
echo $decodedClient;
?>