php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10148 Feature Request
Submitted: 2001-04-03 21:56 UTC Modified: 2001-04-03 22:46 UTC
From: chris at digitekdesign dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.4pl1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chris at digitekdesign dot com
New email:
PHP Version: OS:

 

 [2001-04-03 21:56 UTC] chris at digitekdesign dot com
It would be nice to be able to call a function to return the name and path of a PHP script that is currently running (for instance, say TEST.PHP calls /WEB/PHPSTUFF/LIB.PHP the function would return /WEB/PHPSTUFF/LIB.PHP)

If this is already possible, I haven't been able to find a way to do it.  I've searched the documentation and asked around on different forums.

Thanks!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-03 22:46 UTC] torben@php.net
It's not a function, but it is in the manual. I think you want the
__FILE__ constant.

http://www.php.net/manual/en/language.constants.php

__FILE__
  The name of the script file presently being parsed. If used within
  a file which has been included or required, then the name of the 
  included file is given, and not the name of the parent file. 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 11:01:30 2025 UTC