How can PHP be used to extract specific data from nested arrays within JSON objects?

To extract specific data from nested arrays within JSON objects using PHP, you can first decode the JSON string into an associative array using the `json_decode()` function. Then, you can access the nested arrays using multiple array keys to navigate through the structure and retrieve the desired data.

$jsonString = '{"data": {"name": "John Doe", "age": 30, "address": {"street": "123 Main St", "city": "New York"}}}';
$data = json_decode($jsonString, true);

$address = $data['data']['address'];
$city = $address['city'];

echo $city; // Output: New York