跳转到主要内容

getmessage

Exception::getMessage

Gets the Exception message

ENTITY

final

public

string

Exception::getMessage

Returns the Exception message.

ENTITY ENTITY

ENTITY

Returns the Exception message as a string.

ENTITY

Exception::getMessage example

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

    

ENTITY

Some error message

ENTITY

Throwable::getMessage