php bug?

From: Date: Sun, 26 Sep 2010 07:36:35 +0000
Subject: php bug?
Groups: php.xml.dev 
Request: Send a blank email to [email protected] to get a copy of this message
Hello everyone.
The following is an extract of a routine returning error messages from a xml file:

function title($index)
{
$xml = simplexml_load_file("lingo.xml");
return $xml->message[$index];
}

The problem is that if I call the routine with a value [ex. title(6)] I receive the message, whereas if I call the routine with a variable [ex. title($value) where $value=6] there is no way I can receive the message.

I tried in many different ways but it looks like it's a bug of simple_xml.
Have you found a way around?
Thank you for any input.


Thread (7 messages)

« previous php.xml.dev (#628) next »