Monday, August 8, 2011

.inc vs .php file extention

.inc stands for include.
Some may prefer to name their file page.inc when using the php function include() because it looks prettier.

include('page.inc');

page.inc or page.php both work the same way.

I would stick with the .php extension instead of the .inc extension because the difference is that the .inc is easier to identify when navigating through files in website directory. It has security issues because if positioned in the wrong directory it will not be parse as php by your host if opened directly, making you code readable. But when you have a .php extension php is parsed and the code is not shown to the outside.

No comments:

Post a Comment