public static function realPath(/*string*/ $filePath = '') {
    if('' === $filePath) {
      $filePath = '.';
    }
    $filePath = @realpath($filePath);
    if(false !== $filePath) {
      $filePath = str_replace('\\', '/', $filePath);
      if('/' !== $filePath) {
        $filePath = rtrim($filePath, '/');
      }
    }
    return $filePath;
  }
public static function realPath(/*string*/ $filePath = '') {
    if('' === $filePath) {
      $filePath = '.';
    }
    $filePath = @realpath($filePath);
    if(false !== $filePath) {
      $filePath = str_replace('\\', '/', $filePath);
      if('/' !== $filePath) {
        $filePath = rtrim($filePath, '/');
      }
    }
    return $filePath;
  }
public static function realPath ( /*string*/ $ filePath = '' ) { if ( '' === $ filePath ) { $ filePath = '.' ; } $ filePath = @ realpath ( $ filePath ) ; if ( false !== $ filePath ) { $ filePath = str_replace ( '\\' , '/' , $ filePath ) ; if ( '/' !== $ filePath ) { $ filePath = rtrim ( $ filePath , '/' ) ; } } return $ filePath ; }
Returns an absolute path for the specified file path. The file must exist
on the file system for this call to yield something.

Three important notes:

1) The directory separator will always be a slash (/) character, even on
hosts with a different separator (ex.: Windows)

2) Except for the case of the root directory, no trailing slash will be
added to the absolute path.

3) If an empty string is passed as a value, current directory will be used
as the path.

@param string $filePath to target file (defaults to current directory)
@return string||FALSE absolute path on success, FALSE otherwise
Returns an absolute path for the specified file path . The file must exist on the file system for this call to yield something .