Hello
I have been trying to wrap my head arouns this, but I can't seem to get it to
work the way I want it to. Could someone helpful please tell me how I get this:
<function>
<name>array_pus h</name>
<examples>
<example>
<name>A way to do it</name>
<code>
$array = array("foo", "bar")
$array = array_push($arr ay, "goo")
</code>
</example>
</examples>
</function>
To this:
array (
name -> array_push
examples -> array(
example -> array(
name -> A way to do it
code -> $array = array("foo", "bar")
$array = array_push($arr ay, "goo")
)
)
)
My problems so far has been traversing the xml in a good way and:
1. After parsing, I am left with the code stripped of variables
'$array = array("foo", "bar")' becomes ' = array("foo", "bar")'
2. Newlines in the code disappaers, how do I make them stay?
Anyone feeling overly helpful and could give me an example to make the above
xml into the above array.
--
Sandman[.net]
I have been trying to wrap my head arouns this, but I can't seem to get it to
work the way I want it to. Could someone helpful please tell me how I get this:
<function>
<name>array_pus h</name>
<examples>
<example>
<name>A way to do it</name>
<code>
$array = array("foo", "bar")
$array = array_push($arr ay, "goo")
</code>
</example>
</examples>
</function>
To this:
array (
name -> array_push
examples -> array(
example -> array(
name -> A way to do it
code -> $array = array("foo", "bar")
$array = array_push($arr ay, "goo")
)
)
)
My problems so far has been traversing the xml in a good way and:
1. After parsing, I am left with the code stripped of variables
'$array = array("foo", "bar")' becomes ' = array("foo", "bar")'
2. Newlines in the code disappaers, how do I make them stay?
Anyone feeling overly helpful and could give me an example to make the above
xml into the above array.
--
Sandman[.net]
Comment