Click to See Complete Forum and Search --> : Best way to load html


SuzanneB
06-24-2008, 03:49 AM
I have some PHP that will decide which html to display according to some circumstances. There are many decisions and final outcomes, so the best way to proceed is to have lots of files with html in them and the PHP decides which file to load an include the html with the page it's constructing. What's the best way of loading and "echoing" a file, given that the PHP doesn’t know which until runtime?

tfk11
06-24-2008, 03:55 AM
$html_filename = './path/filename.html';
readfile($html_filename, false);

SuzanneB
06-24-2008, 09:39 AM
Ah! Readfile! I thought there was something like that, but didn't know what it's name was! thanks for that. Works a treat.