note 88500 deleted from function.fopen by danbrown
| From: | danbrown@php.net | Date: | Mon, 08 Jun 2009 23:29:23 +0000 |
| Subject: | note 88500 deleted from function.fopen by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156536@lists.php.net to get a copy of this message | ||
Note Submitter: kabr
----
re: webmaster at myeshop dot fr
The samerecursive mkdir() and fopen() combination without the regexp.
<?php
function fopen_recursive($path, $mode, $chmod=0755)
{
$directory = dirname($path);
$file = basename($path);
if (!is_dir($directory)) {
if (!mkdir($directory, $chmod, 1)) {
return FALSE;
}
}
return fopen ($path, $mode);
}
?>