How can error reporting be enabled in PHP to display errors?

Error reporting in PHP can be enabled by setting the `display_errors` directive in the php.ini file to On. This will allow PHP to display errors directly on the webpage, making it easier to identify and troubleshoot issues with your code.

<?php
// Enable error reporting
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>