Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Parsing data from a Web Service in PHP

Avatar of SashaIsaac
SashaIsaac asked on
PHPWCF
25 Comments1 Solution315 ViewsLast Modified:
We are trying to set up a web service client in drupal. We got the data pulled in, but it is displaying all the fields instead of just certain ones.  For example I only want to display the 'Degree' and 'AcadPlan' code. I am not really that familiar with pulling XML into a page with php.

Here is a link to what this looks like now.

http://provost-test.asu.edu/node/77

Any help is greatly appreciated!
<?
 
$data = xmlrpc('https://webapp.asu.edu/eadvisor/XmlRpcServer', 'eAdvisorDSFind.findDegreeByCollegeAndProgram', 'CLA' , 'undergrad');
 
$xml = new SimpleXMLElement($data->message);
if($xml){
  $data = $xml->params->param->value->array->data;
 
  foreach($data->value as $degree){
    echo '<ul>';
    foreach($degree->struct->member as $element)
    {
       echo '<li>' . $element->name . ' = ' . $element->value . '</li>';
    }
    echo '</ul><hr>';
  }
}
?>
ASKER CERTIFIED SOLUTION
Avatar of Bobaran98
Bobaran98Flag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 25 Comments.
See Answers