Try printing the value of $msg[0] before calling the mapStatusCode() method to see that you are actually sending the correct parameter information.
Roberto
lz wrote:
Hi guys,
I have one file whose job is to map error codes to a specific string:
function mapStatusCode($msg_id)
{
static $authCod=Array(
"1010"=> "Error1",
"1020"=> "Error2.",
);
return $authCod[$msg_id]);
}
Here is I am calling mapStatusCode with a error code #
#include('msg.inc');
function A()
{
// $msg[0] might contain 1010, 1020
echo mapStatusCode($msg[0]);
}
But echo never displays anything!!
If in the mapStatusCode($msg_id), I explicitly set $msg_id=1020, it works!
Do you know what the problem is?
Thanks a lot!