Is it possible to disable the display of deprecated warnings in PHP without rewriting the script to use MySQLi?

When using deprecated functions in PHP, warnings are displayed to alert developers that the functions are outdated and may be removed in future versions. To disable these warnings without rewriting the script to use MySQLi, you can use the error_reporting function to exclude E_DEPRECATED messages. This will prevent the deprecated warnings from being displayed while still allowing other types of errors to be shown.

// Disable deprecated warnings
error_reporting(E_ALL ^ E_DEPRECATED);

// Your PHP code here
// Example:
mysql_connect("localhost", "username", "password");