How can error_reporting be used in PHP scripts to ensure all errors are displayed for debugging purposes?

To ensure that all errors are displayed for debugging purposes in PHP scripts, you can use the `error_reporting` function to set the error reporting level to `E_ALL`. This will display all types of errors, warnings, and notices. Additionally, you can use the `ini_set` function to set the `display_errors` directive to `On` to ensure that errors are displayed on the screen.

<?php
// Set error reporting level to display all errors
error_reporting(E_ALL);

// Display errors on the screen
ini_set('display_errors', 1);

// Your PHP code here
?>