Is it possible to use conditions within an array:
Uses define('COMPANY_ADDRESS_1','something here'); << if empty don't want to be in the array
$invoice->setFrom(array(COMPANY_NAME,COMPANY_ADDRESS_1,COMPANY_ADDRESS_2,COMPANY_TOWN,COMPANY_COUNTY,COMPANY_POSTCODE));
For example COMPANY_ADDRESS_2 is not set and doesn't show in the array so at the moment the output ends up like:
- company name
- company address 1
- <<<<<<<<<< leaves a gap here
- company town
- company county
- company postcode
The output is fine but if nothing is set for example COMPANY_ADDRESS_2 I want to remove it from the array altogether as it's passed to a PDF generator and currently writing as a blank line.