Get relative path to root


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



Copy this code and paste it in your HTML
  1. $relpath = "";
  2. $tempvarrelpathdir = explode("/",dirname($SERVER['PHPSELF'])); for($i=count($tempvarrelpathdir); $i>0; $i--) if($tempvar_relpathdir[$i] != '') $relpath .= "../";

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.