DirectoryIterator::getGroup
DirectoryIterator::getGroup
(PHP 5, PHP 7)
DirectoryIterator :: getGroup - 获取当前DirectoryIterator项目的组
Description
public int DirectoryIterator::getGroup ( void )
获取文件的组ID。
Parameters
该功能没有参数。
Return Values
以数字格式返回当前DirectoryIterator项目的组ID。
Examples
Example #1 DirectoryIterator::getGroup() example
<?php
$iterator = new DirectoryIterator(dirname(__FILE__)
$groupid = $iterator->getGroup(
echo 'Directory belongs to group id ' . $groupid . "\n";
print_r(posix_getgrgid($groupid)
?>
上面的例子会输出类似于:
Directory belongs to group id 42
Array
(
[name] => toons
[passwd] => x
[members] => Array
(
[0] => tom
[1] => jerry
)
[gid] => 42
)
← DirectoryIterator::getFilename
DirectoryIterator::getInode →
© 1997–2017 The PHP Documentation Group
根据知识共享署名许可证v3.0或更高版本授权。