How can UTF-8 encoding be ensured for JSON data in PHP applications?

When working with JSON data in PHP applications, it's important to ensure that the data is encoded in UTF-8 to support international characters. To achieve this, you can use the `json_encode` function with the `JSON_UNESCAPED_UNICODE` option to prevent the encoding of Unicode characters.

$data = array('name' => 'John Doe', 'city' => '東京');
$json = json_encode($data, JSON_UNESCAPED_UNICODE);
echo $json;