I can see a couple of things that may help as starters...
Firstly, I see a lot of code that's been cut and pasted a number of times and the altered a bit.
If you find your self cutting and pasting code to write a script - there's probably an easier way ... and you're making yourself a maintenance nightmare if you insist on duplicating code
Don't copy and paste - write a function. If you have to change bits of the code when you copy and paste, THAT is the clue as to what should be passed into the function as parameters
Second - Don't write long, multiline quotes strings with backslashed quotes within. There are several alternatives, including a here document.
- Code: Select all
$display_block .= <<<DONE
This is a block of text to print
that is several lines long
DONE;