Thread: PHP and XML?
View Single Post
Old 03-31-2008, 08:39 AM   #2 (permalink)
abiko
The Contributor
 
abiko's Avatar
 
Join Date: Feb 2008
Location: Croatia
Posts: 90
Thanks: 4
abiko is on a distinguished road
Default

Well.
Simple usage of XML is - you read data from it, you can structure it how you like.

For using php in XML file - sure - but you must use eval() for that code to be executed.
XML in a PHP file - XML must be in a string
PHP Code:
<?php
 $xml 
"
<?xml version="
1.0" encoding="utf-8"?>
<books>
 <bookInfo>
    <id>12</id>
    <name>The Test Name Of A Book</name>
    <price>18,45</price>
  </bookInfo>
</books>
"
;
?>
Parsing in now real easy using the PHP5s DOM or XPath.

Can you provide more detailed question :) Hope this cleared some things.
__________________
Back from sysadmins to the programmers.
Send a message via ICQ to abiko Send a message via MSN to abiko
abiko is offline  
Reply With Quote