SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict jamesbond's Avatar
    Join Date
    Feb 2001
    Location
    The Netherlands
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best way to display path to file ?

    What I would like is an efficient way to have a .php file display the path to its location.

    I did figure it out in a 'non elegant' way using the UNIX find command.

    <?
    $currentpath = (system("find / -name path.php",$currentpath)) ;
    echo $currentpath;
    ?>

    Which shows the absolute path to path.php.

    It doesn't seem very efficient to me since it has to go searching through a bunch of directories until it finds the file.

    Is there a more efficient way to accomplish this?

  2. #2
    SitePoint Addict jamesbond's Avatar
    Join Date
    Feb 2001
    Location
    The Netherlands
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found the solution myself !

    echo "$SCRIPT_FILENAME";


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •