• PHP Video Tutorials

PHP - xattr Functions


The xattr extension can allow for the manipulation of extended attributes on a filesystem.

To use xattr, we can need a libattr installed.

These functions can only work on filesystems that support extended attributes and have enabled at mount time. Some common filesystems that support extended attributes: ext2, ext3, reiserfs, jfs, and xfs.

This extension doesn't have configuration directives defined in php.ini.

This extension has no resource types defined.

Predefined Constants

The constants are defined below by this extension and can only be available when an extension has either compiled into PHP or dynamically loaded at runtime.

  • XATTR_ROOT (integer) − Set attribute in root (trusted) namespace. Requires root privileges.
  • XATTR_DONTFOLLOW (integer) − Do not follow the symbolic link but operate on symbolic link itself.
  • XATTR_CREATE (integer) − Function will fail if extended attribute already exists.
  • XATTR_REPLACE (integer) − Function will fail if extended attribute doesn't exist.
Sr.No Function & Description
1 xattr_get()

Function can get an extended attribute.

2 xattr_list()

Function can get a list of extended attributes.

3 xattr_remove()

Function can remove an extended attribute.

4 xattr_set()

Function can set an extended attribute.

5 xattr_list()

Function can check if filesystem support extended attributes.


Useful Video Courses


PHP Online Training

45 Lectures 9 hours

Malhar Lathkar


Become PHP Facebook Developer: Password-Less Authentication

34 Lectures 4 hours

Syed Raza


Ultimate PHP & MySQL Web Development Course & OOP Coding

84 Lectures 5.5 hours

Frahaan Hussain


Learn PHP from Scratch

17 Lectures 1 hours

Nivedita Jain


E Commerce Website Development In PHP With PDO

100 Lectures 34 hours

Azaz Patel


PHP in Telugu

43 Lectures 5.5 hours

Vijay Kumar Parvatha Reddy