Return host directory in PHP


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

Returns only the directory path to the current file — no host or filename, just URI directory structure.


Copy this code and paste it in your HTML
  1. <?php
  2. dirname($_SERVER['PHP_SELF']);
  3. ?>

Report this snippet


Comments


You need to login to view comments.