How can error reporting be configured in PHP to display errors on a webpage during development without affecting the production server?

During development, it is helpful to display errors on a webpage in PHP to quickly identify and fix issues. This can be achieved by configuring the error reporting settings in the php.ini file or using the error_reporting() function in your PHP script. To display errors on a webpage during development without affecting the production server, you can set the error_reporting level to E_ALL and enable display_errors in your development environment only.

// Enable error reporting and display errors on a webpage during development
error_reporting(E_ALL);
ini_set('display_errors', 1);