pain.reign pain.reign - 9 days ago 6
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 ?)

Answer

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:

http://www.php.net/manual/en/context.ftp.php

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: http://www.php.net/manual/en/stream.contexts.php

As for the parameters, check this out: http://www.php.net/manual/en/context.php

Comments