What role does the display_errors setting play in showing PHP errors?

The display_errors setting in PHP determines whether errors are displayed directly on the screen or not. When set to "On", PHP errors will be shown on the screen, which can be useful for debugging during development. However, it is recommended to set display_errors to "Off" in a production environment to prevent sensitive information from being leaked to users.

// To turn off displaying PHP errors on the screen
ini_set('display_errors', 0);