What function can be used to decode JSON data in PHP?

To decode JSON data in PHP, you can use the `json_decode()` function. This function takes a JSON string as input and converts it into a PHP variable (array or object) that can be easily accessed and manipulated in your code.

$json_data = '{"name": "John", "age": 30, "city": "New York"}';
$decoded_data = json_decode($json_data);

// Accessing the decoded data
echo $decoded_data->name; // Output: John
echo $decoded_data->age; // Output: 30
echo $decoded_data->city; // Output: New York