Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mkdir context example php

Tags:

php

mkdir

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 ?)

like image 943
pain.reign Avatar asked Nov 12 '22 19:11

pain.reign


1 Answers

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

like image 160
James L. Avatar answered Nov 15 '22 13:11

James L.