I have the following json string collected from a file
{"v":1,"current":{"email_messages_count":0,"pipeline_id":1,"9bf19d1d179d05c17a14023d3022565264c4eb08":"83170420728","red":"83170420728","534":"83170420728","c4bde3465a51ba798737a02f34bd2db867493c2f":"83170420728"}}
I am trying to extract the value from key "9bf19d1d179d05c17a14023d3022565264c4eb08"
Whenever I try to do anything with this element it causes my program to crash. The difference I can see is that the key value starts with a number then characters. If the key value starts with a character then followed by numbers it will work?
Here is the code:
$result = file_get_contents("testfile.txt",true);
$dataIN = json_decode($result, true);
$current = json_encode($dataIN[current], true);
$testData2 = $dataIN[current][c4bde3465a51ba798737a02f34bd2db867493c2f];
echo $testData2;
If I was to run the above code it would work, however if I add:
$testData3 = $dataIN[current][9bf19d1d179d05c17a14023d3022565264c4eb08];
echo $testData3;
The program will crash and I get no output
Any help greatly appreciated, thank you in advance