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


RSS Icon Subscribe to comments

You need to login to post a comment.