php 5: xml to array?
Posted: Fri Jan 30, 2009 7:03 pm
When I'm forced to be compatible to php 4, I use a long xml2array custom function, but by the grace of god this time I get to use php 5. I know there's new functions and I've read the manual over several times but I'm hoping there's a simple solution for what I'm looking for. Everything on the manual looks like overkill for what I need.
All I need to do is turn this xml (from a file in this case):
Into an array so that :
Would print '1'
All I need to do is turn this xml (from a file in this case):
Code: Select all
<a>
<b>1</b>
<c>2</c>
</a>Code: Select all
echo $array['a']['b'];