Hi, I wonder if you can help me.I am doing a php tutorial. I am supposed to be able to open this file:
<?xml version="1.0"?>
<pet>
<name>Polly Parrot</name>
<age>3</age>
<species>Parrot</species>
<parents>
<mother>Pia Parrot</mother>
<father>Peter Parrot</father>
</parents>
</pet>
and this is the php file:
<?php
//set name of xml file
$file = "pet.xml";
//load file
$xml = simplexml_load_file($file) or die ("unable to load xml file");
//access xml data
echo "Name: " $xml->name . "\n";
echo "Age: " $xml->age . "\n";
echo "Species: " $xml->species . "\n";
echo "Parents: " $xml->parents->mother . " and " . $xml->parents->father . "\n";
?>
I have version 5.4 so simple xml should be enables, but I cannot open the file.Thanks