How to include() all PHP files from a directory ?

 Example - 

This example contains four PHP files (test1.php, test2.php, test3.php, test4.php) in a directory. Create one file named as include.php which contains PHP code to include files.







Create include.php outside folder:  

<?php
foreach (glob("folder/*.php") as $filename) {
	include $filename;
}
?>




No comments:

Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...