-
include()
if i had
PHP Code:
if(strlen($something)==0){
//login code
}
if(strlen($something)==0){
include("login.inc.php");
}
with the first one, the code is already there...does the include add the code in when it comes across it? my files are like 25kb now, postly php, and there are huge if/else clauses, i wanna see if i can do includes to reduce the download size...like you know what i mean?
itll only download whats needed, not the whole thing
-
the php file that you specify in the include function will be "included" where the statement is found, so yes
PHP Code:
if(strlen($something)==0){
include("login.inc.php");
}
would be fine
-
ok thanks
but would it really matter since its parsed server side? or would it take less cpu?
-
the only real advantage is that it is less messy and a lot easier for you to work with.
It might save some processing time if you are only including 1 vast section rather than a lot of vast sections in the same file.
-
ok its about 20 lines so ill just leave it then.
thanks
-
I'd do it for 20 lines :)
-