How can error reporting be used to troubleshoot PHP scripts, and what are some common notices that may appear?

Error reporting in PHP can be used to troubleshoot scripts by providing detailed information about any syntax errors, runtime errors, or warnings that may occur during script execution. By enabling error reporting, developers can quickly identify and address issues within their code. Common notices that may appear include undefined variables, deprecated functions, and incorrect syntax. To enable error reporting in PHP, you can use the following code snippet:

```php
error_reporting(E_ALL);
ini_set('display_errors', 1);
```

This code will set the error reporting level to display all errors, warnings, and notices, allowing you to easily identify and troubleshoot any issues within your PHP scripts.