<?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 ?>