Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get name of parent dir php

<?php
  //OUTPUT name of the parent dir no forward or backward slashes
  //USAGE add the code below to the script you need the parent DIR of, that simple.
  basename(__DIR__);
  //OUTPUT: parentDIR 
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #parent #dir #php
ADD COMMENT
Topic
Name
7+7 =