Extract directory from path [duplicate] November 29, 2022 by Tarik dirname $file is what you are looking for