PHP Exception getMessage() Method

PHP Exception Reference : Throw an exception and then output its message

Definition and Usage

The getMessage() method returns a description of the error or behaviour that caused the exception to be thrown.

Syntax

$exception->getMessage()

Technical Details

Return Value: Returns a string

Related Pages

Read more about Exceptions in our PHP Exceptions Chapter.

❮ PHP Exception Reference