PHP 8.5.0 Beta 1 available for testing

Voting

: eight plus zero?
(Example: nine)

The Note You're Voting On

Anonymous
3 years ago
A more simplified version of the method that creates subdirectories:

function path_put_contents($filePath, $contents, $flags = 0) {

if (! is_dir($dir = implode('/', explode('/', $filePath, -1))))
mkdir($dir, 0777, true);
file_put_contents($filePath, $contents, $flags);
}

<< Back to user notes page

To Top