I have a XML with a node called 'e-mail'. I use simplexml_load_file to read the file but when i want to get the row value with $row->e-mail i get just get 0 back.
What's wrong here, all other names work fine so i think it has something to do with 'mail'.
tnx
From the manual
Accessing elements within an XML document that contain characters not permitted under PHP's naming convention (e.g. the hyphen) can be accomplished by encapsulating the element name within braces and the apostrophe.
echo $xml->movie->{'great-lines'}->line;
So you need something like
$row->{'e-mail'}
This should work:
$row->{'e-mail'}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With