How can error_reporting and ini_set be used to troubleshoot PHP script issues?

When troubleshooting PHP script issues, you can use the error_reporting function to set the level of error reporting in your script. Additionally, you can use the ini_set function to dynamically change the configuration settings at runtime. By setting error_reporting to E_ALL and displaying errors, you can easily identify and fix any issues in your PHP script.

// Set error reporting level to display all errors
error_reporting(E_ALL);
ini_set('display_errors', 1);

// Your PHP script code goes here