Example Script is located in /home/insp/public_html/deploy/
I want to return the /home/insp/ section
$path = realpath(__DIR__);
$parts = explode('/', $path);
$newPath = array(
$parts[0],
$parts[1],
$parts[2],
);
$realPath = implode('/', $newPath);
Is there a better/more effeicent way to acheve this?
$_SERVER['HOME']
orgetenv('HOME')
? – Bobby Dec 9 '13 at 21:12<cpanel print="$homedir">
to get the home directory. – Bobby Dec 9 '13 at 21:24