PHP: Finding information on a file


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

Handy function that allows you get some data on a file


Copy this code and paste it in your HTML
  1. $file_info = pathinfo( __FILE__ );
  2. echo $file_info['dirname'] . "<br />";
  3. echo $file_info['basename'] . "<br />";
  4. echo $file_info['filename'] . "<br />";
  5. echo $file_info['extension'] . "<br />";

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.