Hi Folks,
Was after a bit of coding help with functions.
I'm trying to tidy up a lot of code that repeated.
for example, I wrote a phpscript that exports data to a pdf file rather messily, there is a lot of repeated code so as an example, i put the header in to a function as such ;
// Function to print header
function print_header() {
// Print Warwick Logo
pdf_set_parameter($pdf, "FontOutline", "Warwick Logo=c://windows//fonts//fs_war04.ttf");
$arial = pdf_findfont($pdf, "Warwick Logo", "host", 1); pdf_setfont($pdf, $arial, 70);
pdf_show_xy($pdf, "3", 386, 520);
}
print_header() ;
But now the logo doesn't print on the page at all.
Am I using the function properly? Can functions see all current variables?
Is there a better way I should be doing this?
Many Thanks
Mark