mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Add example.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@166736 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
dff79c7193
commit
f0696b6f53
1 changed files with 21 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.xattr-set">
|
||||
<refnamediv>
|
||||
|
@ -62,6 +62,26 @@
|
|||
See also <function>xattr_get</function>, <function>xattr_remove</function>,
|
||||
<function>xattr_list</function>.
|
||||
</para>
|
||||
<example>
|
||||
<title><function>xattr_set</function> example</title>
|
||||
<para>
|
||||
The following code sets extended attributes on .wav file.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$file = 'my_favourite_song.wav;
|
||||
xattr_set($file, 'Artist', 'Someone');
|
||||
xattr_set($file, 'My ranking', 'Good');
|
||||
xattr_set($file, 'Listen count', '34');
|
||||
|
||||
/* ... other code ... */
|
||||
|
||||
printf("You've played this song %d times", xattr_get($file, 'Listen count'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
Loading…
Reference in a new issue