Vikram Rao
Vikram Rao

Reputation: 1078

how to execute a set of php files from a directory

The issue is like this.......

I have Joomla and WordPress installed on one site and I have a set of PHP files, lets say....

file1.php file2.php file3.php and so on....

which are saved in a particular folder lets sat FOLDER-1. These files have some scripts which get data from Joomla or WordPress.

I want to call a refresh option in my template parameters where we ask the user if he wants to refresh the files, If he chooses yes then I want that all PHP files in this FOLDER-1 must run once and perform their respective PHP actions.

Upvotes: 0

Views: 497

Answers (1)

Dan Grossman
Dan Grossman

Reputation: 52372

foreach (glob("*.php") as $filename) {
    include($filename);
}

Adjust glob argument to use whatever directory you want to search for .php files in.

Upvotes: 1

Related Questions