Support for multi-platform PHP directory creation functions We can specify that directories are created under that directory OH. /Gets the directory name of the specified folder
Support for multi-platform PHP Tutorial Directory creation function
We can specify to create a directory under that directory OH.
/Gets the directory name of the specified folder
2 function Get_dir_name ($dir _path, $file)
3 {
4 $dirpath = $dir _path;
5 $dir = Scandir ($dirpath);
6 foreach ($dir as $key = $value)
7 {
8 if (Is_dir ($dirpath. ' /'. $value) && $value! = '. ' && $value! = ' ... ')
7 5
Ten//echo $dirpath. ' /'. $value. ' /'. $file;
11//In the directory to generate a config.php file, of course, this file can be defined by itself
if (!file_exists ($dirpath. ' /'. $value. ' /'. $file))
13 {
$FO = fopen ($dirpath. ' /'. $value. ' /'. $file, ' xb+ '); Here, when I tried to use w+, the result failed,
15//In Windows, I have created success, please note! All recommendations with xb+, compatible with multi-platform
chmod ($file, "0777");
Fwrite ($FO, ' I am a zongzi, here are config file! ') or Die (' profile creation failed!) Check if you have permission to operate this directory and file! ');
Fclose ($FO);
19}
$arr [] = $value;
21}
22}
return $arr;
+}
http://www.bkjia.com/PHPjc/631332.html www.bkjia.com true http://www.bkjia.com/PHPjc/631332.html techarticle support for multi-platform PHP directory creation functions We can specify that directories are created under that directory OH. /Get the directory name of the specified folder support multi-platform PHP Tutorial directory creation function we ...