Ok, so I read the tips.
It looks like I would need to put the entire php script into the section ...
/* PHP CODE HERE, IF NECESSARY */
--- Long PHP Script HERE with no opening/closing php tags ---
/* DO NOT CHANGE THE LINE BELOW */
Then call the script in here, something like this...
$body = <<<EOF
<div align='center'>$bannerAd</div>
EOF;
/* DO NOT CHANGE THE LINE ABOVE */
Am I understanding this correctly?