Combing include PHP files
I have separate php files. I have a master file that I use by include these files like
/include '1.php';
/include '2.php';
/ include '3.php';
Now I want to combine this 3 file to one php file.How can I use them because in my master code there are 3 conditions,like condition 1 uses file 1.php condition 2 uses file 2.php and so on thanx
Answer:
Hi you can write your code this way
<?php
if(condition1) include('file1.php');
else if(condition2) include('file2.php');
else include('file3.php');
?>
you can either write this
<?php
if(condition1) include('file1.php');
if(condition2) include('file2.php');
if(condition3) include('file3.php');
?>
good work !
http://stackoverflow.com/questions/9793845/combing-include-php-files
COMMENTS