Re: [PHP] Adding includes to files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Robert Sossomon" <robert@xxxxxxxxxxxx>

> I need to add PHP calls to include a file to each page as it is
> generated, the only thing is I can't get the includes to come through
> correctly:
> 
> <! Code>
>    $display_block .= "<?php include(\"nav/top_nav.html\"); ?>";
>    $display_block .= "<?php include(\"nav/side_nav.html\"); ?>";
> <! End Code>
> 
> At the end of the generation I write $display_block to a file as

You can use output buffering:

ob_start();
include("nav/top_nav.html"); 
include("nav/side_nav.html"); 
$display_block = ob_get_contents();
ob_end_clean();

---John Holmes...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux