I have a JSON-String
like
{"aaa":"foo", "bbb":"bar", "ccc":"hello", "ddd":"world"}
Actually I recive this string via $_GET
. It is base64 encoded and if I decode it I have this string.
So further is want to use this in PHP
as an object
. For this is do
$data = json_decode( base64_decode( $_GET['data'] ) );
but $data
is NULL
all the time. If I do
echo base64_decode( $_GET['data'] );
Then the valid JSON-String
is printed as expacted.
What am I doing wrong ?
I have tried to call the base64_encode before but same result...