downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Exception::getPrevious> <Exception::__construct
Last updated: Fri, 06 Nov 2009

view this page in

Exception::getMessage

(PHP 5 >= 5.1.0)

Exception::getMessageGets the Exception message

Description

final public string Exception::getMessage ( void )

Returns the Exception message.

Parameters

This function has no parameters.

Return Values

Returns the Exception message as a string.

Examples

Example #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
Exception::getMessage
support resort
11-Mar-2009 07:40
<?php
$client
= new SoapClient ("http://example.com");
try {
   
$response = $client->Client_Function();
} catch(
SoapFault  $e) {
    echo
$e->getMessage();
}
?>

Exception::getPrevious> <Exception::__construct
Last updated: Fri, 06 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites