]> git.sesse.net Git - xml-template/blobdiff - php/attribute-empty.php
Make the PHP attribute-empty hack less ugly.
[xml-template] / php / attribute-empty.php
index e2f02338a6024bf8d96729a9b097b3bdc85ee3b2..d4611404f0503d755f5f2ed56c4f93b669a1bf87 100644 (file)
@@ -1,9 +1,12 @@
 <?php
 require('xml-template.php');
 
+# NULL values are ignored, but having one helps pointing out that
+# the array given is non-associative
+
 $doc = XML_Template_process_file('../xml/clone.xml', array(
        'color' => 'blue',
-       '#things' => ''             # no better way to do it, I'm afraid
+       '#things' => array(NULL)
 ));
 print $doc->dump_mem();
 ?>