Can you provide an example of using GET to retrieve data from a specific URL in PHP?

To retrieve data from a specific URL using GET in PHP, you can use the file_get_contents() function along with the URL you want to retrieve data from. This function will return the contents of the specified URL as a string, which you can then process or display as needed.

$url = 'https://www.example.com/data.json';
$data = file_get_contents($url);

echo $data;