[thelist] getting page name with PHP

Simon Willison simon at incutio.com
Tue Sep 10 15:02:21 CDT 2002


At 12:56 10/09/2002 -0700, you wrote:
> > I think it is in $_SERVER['SCRIPT_FILENAME']
> >
> > HTH!
> >
> > Jay
>
>This DOES give me the page, but with the FULL path -- any way to just
>get the filename itself?

Try the basename function:

$filename = basename($_SERVER['SCRIPT_FILENAME']);

Cheers,

Simon

--
Web Developer, www.incutio.com
Weblog: http://simon.incutio.com/




More information about the thelist mailing list