请问为什么无法创建目录?
下面代码哪里出问题了?<?php
// 创建目录函数
$localhost='../../';
$folder="helloworld/";
function add_folder($path){
$full_path=$localhost.$folder.$path;
if(!file_exists($full_path)){
mkdir($full_path,0777);
}
}
add_folder("laji");
?>
下面代码哪里出问题了?<?php
// 创建目录函数
$localhost='../../';
$folder="helloworld/";
function add_folder($path){
$full_path=$localhost.$folder.$path;
if(!file_exists($full_path)){
mkdir($full_path,0777);
}
}
add_folder("laji");
?>
// 创建目录函数
$localhost='../../';
$folder="helloworld/";
mkdir($localhost.$folder,0777);
function add_folder($path){
$full_path=$localhost.$folder.$path;
if(!file_exists($full_path)){
mkdir($full_path,0777);
}
}
add_folder("laji/");
?>
$folder="helloworld/";
mkdir($localhost.$folder,0777);
function add_folder($path){
global $localhost,$folder;//引用全局变量。
$full_path = $localhost.$folder.$path;
if(!file_exists($full_path)){
mkdir($full_path,0777);
}
}
add_folder("laji/");