* Thus wrote Ryan A ([EMAIL PROTECTED]):
> 
> one last question:
> According to the script I am calling an include file...
> eg:
> if(r=2){include "blah1.php";}
> elseif (r=3){include "blah2.php";}
> and so on....
>
> now blah1,2,3 etc are mostly html code files with php in them.....will this
> slow down performance a lot and be much of a strain? the calling files are
> not large...maybe around 12k each...The reason I choose to go this way of
> course is for easier readibilty ,handleing and space management. Whats your
> experience with this? good or bad?

Well, if it is a big loop then that means that many more hits to
the disk (not taking any sort of disk/php/zend caching into
consideration.) which is a high price to pay.

I would create something like
blah2.php:
  function blah2_html() {
    //output html....
  }

and use include_once() in your if statment and call the function


Personally I would also use the switch statement instead of a if
elesif block for readability:

  switch ($r)  {
    case 2:
      include_once('blah1.php');
      blah1_html();
      break;
    case 3:
      include_once('blah3.php');
      blah3_html();
      break;
  }

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to