View Single Post
Old 02-23-2011, 10:06 AM  
CS-Jay
Confirmed User
 
CS-Jay's Avatar
 
Join Date: Oct 2003
Location: Command Central, West Palm Beach, Fl
Posts: 1,794
Quote:
Originally Posted by HarryMuff View Post
Use DOM? Don't think you can get the textNode children using simplexml.

Code:
$xml =
'<derp>
    <Choice ID="1000">
        <Select NAME="BOB" />
        Monday
    </Choice>
    <Choice ID="1001">
        <Select NAME="Mary" />
        Tuesday
    </Choice>
</derp>';
$dom = new DOMDocument('1.0', 'UTF-8');
$dom->loadXML($xml);
foreach($dom->getElementsByTagName('Choice') as $choice)
{
    $arr[] = $choice->textContent;
}
print_r($arr);
Off to give DOM a try
__________________
I do stuff - aIm CS_Jay_D
CS-Jay is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote