PHP code example of el7cosmos / dirs
1. Go to this page and download the library: Download el7cosmos/dirs library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
el7cosmos / dirs example snippets
// Get user's home directory
$home = home_dir();
echo $home; // e.g., "/home/username"
// Get downloads directory
$downloads = download_dir();
echo $downloads; // e.g., "/home/username/Downloads"