What are best practices for handling error reporting in PHP to suppress warnings?

When handling error reporting in PHP to suppress warnings, it is best practice to use the error_reporting function to set the desired error level and then use the ini_set function to turn off specific types of errors, such as warnings. This allows for more control over which errors are displayed to the user.

// Set the error reporting level
error_reporting(E_ALL);

// Turn off displaying warnings
ini_set('display_errors', 0);