Allright @ginerjm, got it! That's basically how I approach coding, in a modular way ie I create a piece of code that performs a certain function that gets used a lot. I might start using laravel or symfony just so I can escape writing all those pesky little subroutines like login, registration, password hashing, difficulty checking etc... I mean I presume those kinds of things have already been done to death by others and should/would be available in a framework, right ?
I have a similar approach to displaying content, I use a function : echo (getContentByType("head1")); to display a header, pagecontent and footer, I will have to look into simplifying that to your approach where it displays the entire screen , introducing pre filled variables.
I tried reading the pages on heredocs, barand sent through but as of yet it doesn't make a whole lot of sense to me ... I will need to read it couple more times I guess and perhaps reference some other sources.
anyway thanks for the tips bruddha, much appreciated