printing - PHP - current folder / directory name -


this question has answer here:

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__)

http://php.net/manual/en/function.getcwd.php

http://php.net/manual/en/function.dirname.php


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -