Quantcast
Channel: PHP including in functions - Stack Overflow
Viewing all articles
Browse latest Browse all 3

PHP including in functions

$
0
0

I'm working on changing over a large, somewhat poorly written (but not terribly so), PHP website to use a class which stores functions which do things like write the standard page header with arguments to change things like the text of the header. The old version used a copied and pasted HTML header in each file with something like:

<div class="left"><?php include("left.php"); ?></div>

Where the included file has both non-echoed HTML and normal PHP. These includes seem ok to keep using, but I'm just not sure how they'll work, as to my knowledge, included files just replace the include() method directly.

Would it be better to:
-Re-write the included files to echo all standard HTML
-Simply move the content of these files into my new function where appropriate (to my knowledge, they're not used anywhere except where they would be in my new function)
-Something else

Thanks.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images