PHP Exception getCode()

PHP Exception getCode


Definition :

The getCode() method returns an integer which can be used to identify the exception.

Syntax

   $exception->getCode()


Parameters

     No parameter is required.

Given below example Shows the Exception getCode() method.

Output :  The exception code is: 25