xattr_get
xattr_get
Get an extended attribute
**xattr_get** string $filename string $name int $flags
This function gets the value of an extended attribute of a file.
filenameThe file from which we get the attribute.
nameThe name of the attribute.
flags
Returns a string containing the value or false if the attribute doesn't exist.
Voorbeeld: Checks if system administrator has signed the file
<?php
$file = '/usr/local/sbin/some_binary';
$signature = xattr_get($file, 'Root signature', XATTR_ROOT);
/* ... check if $signature is valid ... */
?>
xattr_list``xattr_set``xattr_remove