pain.reign pain.reign - 1 month ago 34
PHP Question

mkdir context example php

In php 5.0 context was added to mkdir. But how to use it and what useful things can it do?

And what parameters can be used for context that is passed to mkdir ?)


I believe that the context option was added so that mkdir could be used instead of a connection specific mkdir in PHP like ftp_mkdir:

Although there doesn't seem to be a ton of advantage in adding the context to the mkdir, there is plenty of advantage in adding it to all of the file system creation functions:

As for the parameters, check this out: