basename
�������� ��� ����� �� ����.
��������� :
string basename(string $path)
�������� �������� ��� �� ���� $path
�������:
��� ������� ��������� ������������ ��� ������, ��� � �������� ����� ��� Windows.
�������� ��� ����� �� ����.
��������� :
string basename(string $path)
�������� �������� ��� �� ���� $path
�������:
echo basename("/home/somebody/somefile.txt"); // ������� "somefile.txt" echo basename("/"); // ������ �� ������� echo basename("/."); // ������� "." echo basename("/./"); // ����� ������� "."������� basename() �� ��������� ������������� �����. ��� ������ ����� ����� ������ ����� ������ ������� ����� � ���������� ��.
��� ������� ��������� ������������ ��� ������, ��� � �������� ����� ��� Windows.
dirname
�������� ��� ��������.
��������� :
string dirname(string $path)
���������� ��� ��������, ���������� �� ���� $path. ������� �������� "�������" � ����� �������� ������������� ��������, ������� ������� � ��������:
�������� ��� ��������.
��������� :
string dirname(string $path)
���������� ��� ��������, ���������� �� ���� $path. ������� �������� "�������" � ����� �������� ������������� ��������, ������� ������� � ��������:
echo dirname("/home/file.txt"); // ������� "/home" echo dirname("../file.txt"); // ������� ".." echo dirname("/file.txt"); // ������� "/" ��� Unix, // "\" ��� Windows echo dirname("/"); // �� �� ����� echo dirname("file.txt"); // ������� "."���� ������� dirname() �������� ������ ��� �����, ��� ������ ".", ��� �������� "������� �������".
tempnam
���������� ���������� ��� ����� � ������������ ��������.
��������� :
string tempnam(string $dir, string $prefix)
���������� ��� ����� � �������� $dir � ��������� $prefix � �����, ������ ���, ����� ��������� ��� ���� ������ � ������� ���� ��� ��������.
��� ����� � ������ $prefix �������������� ����� ��������� �����.
��������, ����� tempnam("/tmp","temp") ����� ���������� /tmp/temp3a6b243c.
���� ����� ��� ����� ������� � ������� ��������, ��������� $dir="."
���������� ���������� ��� ����� � ������������ ��������.
��������� :
string tempnam(string $dir, string $prefix)
���������� ��� ����� � �������� $dir � ��������� $prefix � �����, ������ ���, ����� ��������� ��� ���� ������ � ������� ���� ��� ��������.
��� ����� � ������ $prefix �������������� ����� ��������� �����.
��������, ����� tempnam("/tmp","temp") ����� ���������� /tmp/temp3a6b243c.
���� ����� ��� ����� ������� � ������� ��������, ��������� $dir="."
realpath
����������� ������������� ���� � ����������.
��������� :
string realpath(string $path)
����������� ������������� ���� $path � ����������, �.�. ������������ �� �����.
������:
����������� ������������� ���� � ����������.
��������� :
string realpath(string $path)
����������� ������������� ���� $path � ����������, �.�. ������������ �� �����.
������:
echo realpath("../t.php"); // ��������, /home/t.php echo realpath("."); // ������� ��� �������� ������������, ������� ������ � ��������� $path, ������ ������������, ����� ������� ��������� false.