如果我有很多函数,是把它们全部放在一个大文件里更好,还是把它们分成几个相关函数的文件更好?所谓更好,是指对于可维护性和服务器处理请求的效率来说是否更好。
例如,目前我的所有文件都在一个名为"include.php"的文件中。但将其改为包含其他文件的包含文件是否更明智呢?
例如,目前我的所有文件都在一个名为"include.php"的文件中。但将其改为包含其他文件的包含文件是否更明智呢?
<?php
include('/functions/user.php');
include('/functions/admin.php');
include('/functions/content.php');
include('/functions/nav.php');
include('/functions/database.php');
include('/functions/other_junk.php');
?>