Prawn help See what's wrong with this code?
When running this module, the following Scarlet Letter part error Warning:mkdir () [Function.mkdir]: No such file or directory
/**
* Function Name: Createdir
* Function function: Create folder
* Input Parameters:
$root----------------Root Path
$type----------------Types
* Function return Value: Return value description
* Other Instructions: description
*/
function Createdir ($root, $type)
{
if (!file_exists ($root. " /". $type))
{
$dir _arr = $root. " /". $type;
if (mkdir ($dir _arr) &&chmod ($dir _arr,0777))
{
Return true;
}
Else
{
Return false;
}
}
Else
{
Return true;
}
}
------Solution--------------------
PHP Code
if (!file_exists ($root. " /". $type))// here will be! Remove {$dir _arr = $root. " /". $type;
------Solution--------------------
BOOL MkDir (string $pathname [, int $mode = 0777 [, bool $recursive = False [, resource $context]])
Take mode, with true, to create recursively. [Email protected], check the mkdir return value.