-3

Possible Duplicate:
SimpleXML Reading node with a hyphenated name

I have XML with nodes contain dashes:

  <max-passwd-length>32</max-passwd-length>
  <max-email-length>128</max-email-length>

I used these lines:

$s = simplexml_load_file('rss-0.91.xml');
print $s->max-email-length->title

But I get PHP error because there are dashes, what can I do to solve this issue?

P.S. I cannot edit the XML file to remove dashes.

Community
  • 1
  • 1
Houranis
  • 361
  • 2
  • 4
  • 16

1 Answers1

2

Try this $s->{'max-email-length'}->title

peterm
  • 91,357
  • 15
  • 148
  • 157