<?php
// JSON data to decode
$json_data = '{"name":"John Smith","age":30,"city":"New York"}';
// Decode JSON data into a PHP object
$php_object = json_decode($json_data);
// Access object properties
echo "Name: " . $php_object->name . "<br>";
echo "Age: " . $php_object->age . "<br>";
echo "City: " . $php_object->city . "<br>";
?>
Name: John Smith
Age: 30
City: New York
json_decode()
` function to decode the JSON data into a PHP object. We can then access the object properties using the object operator `->
`.