printing - PHP - current folder / directory name -
this question has answer here:
- get parent folder of current file php 6 answers
how can current folder/directory name in php?
i have 2 pages on site:
/about , /help
this code (in , page):
<?php echo dirname("index.php"); ?> i want return: 'about' if on page. , return 'help' if on page. returns nothing.
if on path: http://www.website.com/about/index.php want return about
getcwd();
or
dirname(__file__);
or (php5)
basename(__dir__)
Comments
Post a Comment