Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. <?php
  2.  $dir = 'myDir';
  3.  
  4.  // create new directory with 777 permissions if it does not exist yet
  5.  // owner will be the user/group the PHP script is run under
  6.  if ( !file_exists($dir) ) {
  7.   mkdir ($dir, 0777);
  8.  }
  9.  
  10.  file_put_contents ($dir.'/test.txt', 'Hello File');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement