I wonder if I need to use “.php” for the php snippet files I must include in my principal page with include_once(...). When included in my code those snippets are handled as php instructions I guess so, then can we avoid the extension (snippets are in a folder named ‘php’ so no confusions).
Anyway isn’t that going to make serious disturbances within my code ?
No, you don’t need to use “.php” extension for “include_once()” or “include()”. You may use any extension like may be .txt or .inc. The point to note that any PHP code in the included file is enclosed in the PHP tag, otherwise it will be treated as HTML.
Another point to consider is to not keep sensitive information in the included files (mainly if you choose to give them a non-.php extension) to prevent them being accessed on the browser. Or keep those files outside your document root.