How can JSON data be efficiently read and stored in PHP?

To efficiently read and store JSON data in PHP, you can use the `json_decode()` function to decode the JSON string into a PHP variable. This function will return an array or an object depending on the `assoc` parameter. You can then store this data in a variable for further processing or manipulation.

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

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

// Store the decoded data in variables for further use
$name = $decodedData['name'];
$age = $decodedData['age'];
$city = $decodedData['city'];

// Output the stored data
echo "Name: $name, Age: $age, City: $city";