$ php -a
php > echo posix_getpwuid(posix_geteuid())['dir'];
"/Users/***"
posix_geteuid — 現在のプロセスの有効なユーザー ID を返す
posix_getpwuid — 指定 ID のユーザーに関する情報を返す
Go to list of users who liked
More than 5 years have passed since last update.
$ php -a
php > echo posix_getpwuid(posix_geteuid())['dir'];
"/Users/***"
posix_geteuid — 現在のプロセスの有効なユーザー ID を返す
posix_getpwuid — 指定 ID のユーザーに関する情報を返す
Register as a new user and use Qiita more conveniently
Go to list of users who liked