add php code in included file

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 11
Joined: Thu Mar 07, 2013 2:00 am

Thu Mar 07, 2013 3:25 am

Just specify the PHP code in the xyz.php file and include the file.

php-forum Fan User
php-forum Fan User
Posts: 974
Joined: Mon Oct 01, 2012 12:32 pm

Thu Mar 07, 2013 12:11 pm

If it's code that is essential to your project's performance, make sure you require or require_once instead of include. Often it seems like people go with include to avoid the possibility of a fatal error if not found, but ignoring that error if it comes up will just lead to other issues that will make for a longer hunt for the root cause.

Post Reply