Skip to content

Instantly share code, notes, and snippets.

@apatton-cnet
Last active December 20, 2015 10:09
Show Gist options
  • Save apatton-cnet/6113062 to your computer and use it in GitHub Desktop.
Save apatton-cnet/6113062 to your computer and use it in GitHub Desktop.
<?php
$things = array (
'customer',
'invoicetype',
'invoicenumber',
'status',
'currency',
'period',
'invoicedate',
'duedate',
'bank',
'invoiceaddressnumber',
'deliveraddressnumber',
'headertext',
'footertext'
);
foreach ($things as $thing) {
${$thing}Node = $this->createTextNode($invoice->get{$thing}());
${$thing}Element = $this->createElement($thing);
${$thing}Element->appendChild({$thing}Node);
$headerElement->appendChild(${$thing}Element);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment