PHP/File Directory/dirname
Версия от 10:37, 26 мая 2010; (обсуждение)
dirname.php
<?php
$path = "/home/www/data/users.txt";
$dirname = dirname($path); // $dirname contains "/home/www/data"
?>
Use dirname() with predefined variable $SCRIPT_FILENAME to obtain the complete path of the script executing the command
<?
$dir = dirname($SCRIPT_FILENAME);
print $dir;
?>