Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The VeryTime,Stay informed and read the latest news today from The VeryTime, the definitive source.

How to Change File Ownership in PHP

7
    • 1). Create a new text file with your favorite text editor. Paste the following PHP tags into it:

      <?php

      ?>

      All the code will go within these tags.

    • 2). Paste the following code to change the owner of the file:

      $filename = "afile.txt";

      $user_name = "root";

      chown($filename, $user_name);

      This changes the owner of the file "afile.txt" to the "root" user. Replace the file name and user name with the ones you would like to use.

    • 3). Save your script by hitting the "Ctrl" and "S" keys simultaneously.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.