Exception::getMessage

(PHP 5 >= 5.1.0)

Exception::getMessageGets the Exception message

Опис

final public string Exception::getMessage ( void )

Returns the Exception message.

Параметри

В цієї функції немає параметрів.

Значення, що повертаються

Returns the Exception message as a string.

Приклади

Приклад #1 Exception::getMessage() example

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

Наведений вище приклад виведе щось подібне до:

Some error message

Прогляньте Також

add a note add a note

User Contributed Notes

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