Exception::getMessage

(PHP 5 >= 5.1.0)

Exception::getMessageGets the Exception message

Beskrivelse

final public string Exception::getMessage ( void )

Returns the Exception message.

Parametre

This function has no parameters.

Returnerings Værdier

Returns the Exception message as a string.

Eksempler

Eksempel #1 Exception::getMessage() example

<?php
try {
    throw new 
Exception("Some error message");
} catch(
Exception $e) {
    echo 
$e->getMessage();
}
?>

The above example will output something similar to:

Some error message

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top