How can error suppression be used in PHP to prevent default error messages from being displayed?
Error suppression in PHP can be achieved by using the "@" symbol before a statement that may produce an error. This prevents default error messages from being displayed to the user, which can help improve the security and user experience of a website. However, it is important to use error suppression judiciously and only when necessary, as it can make debugging more challenging.
// Example of using error suppression in PHP
$result = @file_get_contents('example.txt');
if ($result === false) {
echo "An error occurred while trying to read the file.";
}