$_SERVER[\'DOCUMENT_ROOT\']
returns
/usr/local/apache/htdocs/
is there a way to get
/home/us
with preg_replace function to find absolute path from __FILE__ you can easily find with anything home user. Here short my code :
__FILE__
$path_image_you_want = preg_replace('#/public_html/([^/]+?)/.*#', '/public_html/$1/images", __FILE__);