I'm working on a PHP project and have encountered a bit of a problem. I'm struggling to figure out how to handle uncaught exceptions in PHP. Every time I encounter an exception that is not caught, it crashes the whole application and displays an ugly error message to my users.
I want to improve the user experience by gracefully handling these exceptions and displaying a more friendly error message instead. I'm sure there must be a way to do this, but I'm not sure where to start.
Can anyone guide me on how to handle uncaught exceptions in PHP? Is there a specific function or technique I should be using? Any code examples or suggestions would be highly appreciated!
Thanks in advance!