What function in PHP can be used to decode JSON data retrieved from a database?
To decode JSON data retrieved from a database in PHP, you can use the `json_decode()` function. This function takes a JSON string as input and converts it into a PHP variable. This allows you to work with the data in an array or object format within your PHP code.
// Assuming $jsonString contains the JSON data retrieved from the database
$data = json_decode($jsonString, true);
// Access the decoded data as an array
echo $data['key'];