How can JSON data be decoded in PHP to create a usable data structure like an array?

To decode JSON data in PHP and create a usable data structure like an array, you can use the `json_decode()` function. This function takes a JSON string as input and converts it into a PHP variable, typically an array or an object. You can then access the decoded data as you would with any other PHP array.

// JSON data to be decoded
$jsonData = '{"name": "John", "age": 30, "city": "New York"}';

// Decode JSON data into a PHP array
$decodedData = json_decode($jsonData, true);

// Access the decoded data
echo $decodedData['name']; // Output: John
echo $decodedData['age']; // Output: 30
echo $decodedData['city']; // Output: New York