Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick question

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
I have a controller file with several includes, many of the included pages contain pure html/javascript, and many have those as well as php.

Currently all are saved as php files...

the html/javascript files are on the order of 30-100 lines...

will I be saving myself any processing time (noticeable or otherwise) by renaming these to .html files, or with an include will they be pre-processed anyway?

-Rob
 
Sure, but they're running through the parser if they're .php files. By default, my setup does not have the php parser bother with .html tags, regardless of <?php ?> tags.

So, if I include a .html file from a php page is it now parsed or not parsed? Or is the answer, they're included verbatim, and now parsed since they're within a .php file?

-Rob
 
From When a file is included, parsing drops out of PHP mode and into HTML mode at the beginning of the target file, and resumes again at the end. For this reason, any code inside the target file which should be executed as PHP code must be enclosed within valid PHP start and end tags.

The filename does not matter. It's going through the parser in any regard. It's just that the parser only parses that which is within the appropriate tags. Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top