Re: Repetetive code question [message #179637 is a reply to message #179632] |
Thu, 15 November 2012 12:47 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 11/15/2012 7:26 AM, Dynamo wrote:
> Not sure if this is the right place to ask this question as it is more
> an html query than a php one but here goes anyway.
>
> I have a large chunk of html code that is used to build an extensive
> drop down menu. The same code is used on all 30 of my web pages. So I
> have seperated the code into a txt file called menu.txt and used the
> following php code to get the file contents:
> [
> <?php
> $mymenu=file_get_contents('menu.txt');
> echo $mymenu;
> ?>
> ]
> Everthing works fine but is this good practice and is there a better
> way.
>
>
> TIA
> Dynamo
>
Just include() the file.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|