• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. XML Server > PHP and XML

PHP and XML

We can make a PHP file that serves up straight XML; in fact, it is little more than an XML file itself.

PHP

<?php
header( "Content-Type: text/xml");
echo  '<?xml version="1.0" encoding="UTF-8"?> ';
echo  '<Quiz>';
echo  '<Question>';
echo  'Einstein or Bohr:  Who got the Nobel Prize for Physics?';
echo  '<Answer score="0">Einstein</Answer>';
echo  '<Answer score="0">Bohr</Answer>';
echo  '<Answer score="1">Both</Answer>';
echo  '<Answer score="0">Neither</Answer>';
echo  '</Question>';
php?>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint