Jump to content

XML Data Parse


dgywft

Recommended Posts

I am having troubles loading an xml file, without it just out displaying all the information right away into my php document. Example, i have a php file that runs a command line call to generate some xml, the file name on the server is like fontxml.php (header set to xml though), and its output is like this (when viewing the page source):

 

<?xml version="1.0" encoding="UTF-8" ?>

<report>

<fonts>

<font>

  <commonName>Arial</commonName>

  <nativeName>Arial</nativeName>

  <fixedWidth>no</fixedWidth>

  <fixedSizes>no</fixedSizes>

  <copyright>Copyright © 2010 by Apple.</copyright>

</font>

</fonts>

</report>

 

My problem is, I want to display just the "commonName" value into a certain page design. When I do an include, the entire xml data is just opened into my document right away. I have tried loading with simplexml methods, nothing works. Any ideas on this?

Link to comment
https://forums.phpfreaks.com/topic/223113-xml-data-parse/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.