As per discussion How to check if a string can be used as a variable name in PHP? the user TIM is giving there a good answer but still not solving my problem.
I am doing the call exactly like that, but on production server they have magic quotes gpc active! and.. of course.. i can't disable it, i can't ask to disable and last but not least, i can't disable it during runtime (as per manual). So in this case, even if using
echo $xml->example->{'phone-number-1'};
php is trying to execute a mathematical operation between that stuff and i am really becoming mad to understand how to access to that "node" in this case.
And of course, if i test this with magic quotes OFF, everything is ok as per manual.
Thank you in advance
var_dump
then it means that the variable does not exist. It may be that the XML parser you're using has decided that the element cannot be generated as a valid PHP variablename, and is thus not creating it at all. But need to see more code to know more about that. – SDC Dec 6 '12 at 14:55