Array of Error Codes: Key/Values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm new to php and i'm looking to setup an array (or what work best) of codes and corresponding error strings, for example (pseudo code):
ERROR_CODES = array('-1' => 'Error opening file', '-2' => 'General File IO Error', '-3' => 'Database connection error');

Access these string values using the key codes (negative key values) to formulate a SoapFault, e.g.:
throw new SoapFault('-1', ERROR_CODES[-1], 'actor', 'detail', 'name', 'header');

How best to implement this in php?

Thanks,
Brendan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux