riunix Posted March 3, 2007 Share Posted March 3, 2007 i use conditional statement like 'switch' for "include". ex : index.php $a=1; switch($a){ case 1:include 'a.php';break; case 2:include 'b.php';break; case 3:include 'c.php';break; case 4:include 'd.php'; } My question is : note : i wanna to know the speed if i use many include in conditional platform. are they (a.php and b.php) load(compile) it all when index.php called? or only a.php?? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 3, 2007 Share Posted March 3, 2007 The only code that will be loaded will be that of the condition. So if $a is 4 only d.php will load. PHP will not load all the cases. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.