I am generating static HTML pages using output buffering using an include.
Is there any way to prevent certain parts of the php code being parsed? so that rather than having the output, the php is still intact?
According to the PHP documentation:
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward. However, all functions and classes defined in the included file have the global scope.
With that said, I don't think you can use include here. If you don't want PHP code to be parsed by the PHP interpreter, I would use file_get_contents() or something similar. This will allow you to fetch the file without any of the PHP code being parsed.