![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Oct 2003
Location: Command Central, West Palm Beach, Fl
Posts: 1,794
|
PHP and xml help!
I'm a bit stuck and hope someone can lend a hand. I cannot get the value of, Choice, using simplexml.
Here's the xml: PHP Code:
PHP Code:
__________________
I do stuff - aIm CS_Jay_D |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
You're going to want an XML parser to parse the XML into an array.
http://php.net/manual/en/function.xml-parse.php http://php.net/manual/en/function.xm...nto-struct.php
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Join Date: Oct 2003
Location: Command Central, West Palm Beach, Fl
Posts: 1,794
|
Quote:
__________________
I do stuff - aIm CS_Jay_D |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Dec 2005
Posts: 271
|
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); |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Oct 2003
Location: Command Central, West Palm Beach, Fl
Posts: 1,794
|
Quote:
__________________
I do stuff - aIm CS_Jay_D |
|
![]() |
![]() ![]() ![]() ![]() ![]() |