PHP posix_getpwuid() Function Last Updated : 28 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The posix_getpwuid() function is an inbuilt function in PHP that returns data related to a user using its user-id. This function returns an array with user information. Syntax: posix_getpwuid(int $user_id): array|falseParameter: This function accepts a single parameter: user_id: This parameter specifies the user identifier.Return Value: This function returns an associative array with some elements. Elements of the associative array are name, password, uid, gid, geckos, dir, and shell. If it will fail it returns "false". Example 1: The following code demonstrates the posix_getpwuid() function. PHP <?php $userinfo = posix_getpwuid(1000); print_r($userinfo); ?> Output: Array ( [name] => dachman [passwd] => x [uid] => 1000 [gid] => 1000 [gecos] => dachman,,, [dir] => /home/dachman [shell][/shell] => /usr/bin/zsh ) Note: Output will be different according to your system. Example 2: The following code demonstrates the posix_getpwuid() function. PHP <?php $userinfo = posix_getpwuid(10000); if ($userinfo) { echo "User is available"; } else { echo "User is not available"; } ?> Output: User is not available Reference: https://www.php.net/manual/en/function.posix-getpwuid.php Comment More infoAdvertise with us Next Article PHP | SplFileInfo getOwner() Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-POSIX Similar Reads PHP | getcwd( ) Function The getcwd() function in PHP is an inbuilt function which is used to return the current working directory. This function does not accepts any parameter and returns the current working directory on successful function call or FALSE on failure. Syntax: getcwd() Parameters: This function does not accep 2 min read PHP get_resource_id() Function The get_resource_id() function is an inbuilt function in PHP that returns the integer id given resource. This function provides a safe way of generating integers for a resource. Syntax: get_resource_id($resource) ;Parameters: This function accepts one parameter that are described below: $resource: 1 min read PHP | inet_pton() Function The inet_pton() function is an inbuilt function in PHP which converts a readable format IP address into a packed 32bit IPv4 or 128bit IPv6 address. Syntax: string inet_pton( string $ip_address ) Parameters: This function accepts single parameter as mentioned above and described below: $ip_address: I 1 min read PHP | SplFileInfo getInode() Function The SplFileInfo::getInode() function is an inbuilt function of Standard PHP Library (SPL) in PHP which is used to get the inode number for the filesystem object. Syntax: int SplFileInfo::getInode( void) Parameters: This function does not accept any parameter. Return Value: This function returns inod 1 min read PHP | SplFileInfo getOwner() Function The SplFileInfo::getOwner() function is an inbuilt function of Standard PHP Library (SPL) in PHP which is used to get the owner of the file. The owner ID is returns in the numerical format. Syntax: int SplFileInfo::getOwner( void ) Parameters: The function does not accept any parameter. Return Value 1 min read PHP password_get_info() Function The password_get_info() is an inbuilt PHP function where detailed information regarding the given hash will be returned. Syntax: password_get_info(string $hash): arrayParameter: This function accepts a single parameter: hash: This parameter defines the hash of the password by creating the password_h 1 min read Like