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

To enable error reporting in PHP to display error messages, you can set the `error_reporting` directive in your PHP code. This directive controls which types of errors are reported and displayed. By setting it to `E_ALL`, you can display all types of errors, warnings, and notices.

// Enable error reporting
error_reporting(E_ALL);
ini_set('display_errors', 1);