Get full path of current file


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //get full path including filename of current file
  2. $fileTarget = __FILE__;
  3. // get absolute path
  4. $path = dirname($fileTarget);
  5. //or shortform
  6. $path = dirname(__FILE__);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.