简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM