1 2 3 4 5 6 7 8
<?php $string='{"name": "John Doe", "Class": 45}'; // <-- if you can make it as valid json, you can use this method. $json=json_decode($string); echo $json->name."\n"; echo $json->Class; ?>
1 2
John Doe 45