Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

evaluate home tilde ~ in php

function expand_tilde($path)
{
    if (function_exists('posix_getuid') && strpos($path, '~') !== false) {
        $info = posix_getpwuid(posix_getuid());
        $path = str_replace('~', $info['dir'], $path);
    }

    return $path;
}
Source by compwright.com #
 
PREVIOUS NEXT
Tagged: #evaluate #home #tilde #php
ADD COMMENT
Topic
Name
6+5 =