PHP will display errors and warnings on the screen according to the level of error reporting defined in either the php.ini file or at runtime using the error reporting function. Determine the error level you want to suppress. For example E-WARNING refers to all warning messages. Insert a call to the error-reporting function into the code, either at the beginning of the file or prior to where you want to suppress on-screen warnings. Pass the constant for all errors, a carat, and the constant for all warnings to display all errors except warnings and call the error-reporting function again if you want to display on-screen warnings at a future point in the application.
Hey! PHP will display errors and warnings on the screen according to the level of error reporting defined in either the php.ini file or at runtime using the error reporting function. Determine the error level you want to suppress. For example E-WARNING refers to all warning messages. Insert a call to the error-reporting function into the code, either at the beginning of the file or prior to where you want to suppress on-screen warnings. Pass the constant for all errors, a carat, and the constant for all warnings to display all errors except warnings and call the error-reporting function again if you want to display on-screen warnings at a future point in the application.