1. Go to this page and download the library: Download olinox14/path-php 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/ */
olinox14 / path-php example snippets
use Path\Path;
// Get the parent directory of the current script file and list its subdirs
$script = new Path(__file__);
$dir = $script->parent();
var_dump($dir->dirs());
// Get the path of the working directory, iterate over its files and change their permissions
$path = new Path('.');
foreach($path->files() as $file) {
$file->chmod(755);
}
// Put content into a file
$path = (new Path('.'))->append('readme.md');
$path->putContent('new readme content');
// And many more...
use Path\Path;
$path = new Path('./foo');
$path = new Path('/foo/bar/file.ext');
$path = new Path(__file__);
$path = new Path(__file__);
$dir = $path->parent();
foreach ($dir->files() as $file) {
if ($file->ext() === 'html') {
$file->rename($file->name() . '.md');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.