Read an XML PropertyList

  1. <?php
  2. /**
  3.  * Examples for how to use CFPropertyList
  4.  * Read an XML PropertyList
  5.  * @package plist
  6.  * @subpackage plist.examples
  7.  */
  8.  
  9. // just in case...
  10. error_reportingE_ALL );
  11. ini_set'display_errors''on' );
  12.  
  13. /**
  14.  * Require CFPropertyList
  15.  */
  16. require_once(dirname(__FILE__).'/../CFPropertyList.php');
  17.  
  18.  
  19. /*
  20.  * create a new CFPropertyList instance which loads the sample.plist on construct.
  21.  * since we know it's an XML file, we can skip format-determination
  22.  */
  23. $plist new CFPropertyListdirname(__FILE__).'/sample.xml.plist'CFPropertyList::FORMAT_XML );
  24.  
  25. /*
  26.  * retrieve the array structure of sample.plist and dump to stdout
  27.  */
  28.  
  29. echo '<pre>';
  30. var_dump$plist->toArray() );
  31. echo '</pre>';
  32.  
  33. ?>

Documentation generated on Fri, 01 Jan 2010 21:33:33 +0100 by phpDocumentor 1.4.1