Write a PHP script that communicates with a REST API using cURL or an HTTP library such as Guzzle, retrieves data in JSON format, parses the JSON response, and displays the data in a formatted way on a web page. The REST API endpoint and parameters should be provided as variables in the script. Handle any possible errors such as invalid response or network failure. Add appropriate comments and error handling in the code.
This prompt doesn't seem malicious.