I have the following JSON Object stored in a text file(data.txt):
{"player":"black","time":"0","from":"2c","to":"3d"}
Which i read using php:
<?php
$data = file_get_contents('data.txt');
?>
Question: Is there an easy way to convert $data to a PHP associative array. I have tried using json_decode($data); but that did not work, any suggestions?
json_decode($data)not work?json_decodablejust fine.