From a142babd0f2a3f4535b2d76bce493ec9674faca6 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Sat, 3 Feb 2007 08:13:44 +0000 Subject: [PATCH] WS, preparing for the new doc style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@228836 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/filesystem/functions/basename.xml | 84 +-- reference/filesystem/functions/chgrp.xml | 60 +- reference/filesystem/functions/chmod.xml | 150 ++--- reference/filesystem/functions/chown.xml | 56 +- .../filesystem/functions/clearstatcache.xml | 120 ++-- reference/filesystem/functions/copy.xml | 108 ++-- reference/filesystem/functions/delete.xml | 46 +- reference/filesystem/functions/dirname.xml | 120 ++-- .../filesystem/functions/disk-free-space.xml | 62 +-- .../filesystem/functions/disk-total-space.xml | 62 +-- reference/filesystem/functions/fclose.xml | 68 +-- reference/filesystem/functions/feof.xml | 76 +-- reference/filesystem/functions/fflush.xml | 40 +- reference/filesystem/functions/fgetc.xml | 72 +-- reference/filesystem/functions/fgetcsv.xml | 192 +++---- reference/filesystem/functions/fgets.xml | 138 ++--- reference/filesystem/functions/fgetss.xml | 76 +-- .../filesystem/functions/file-exists.xml | 92 ++-- reference/filesystem/functions/file.xml | 124 ++--- reference/filesystem/functions/fileatime.xml | 88 +-- reference/filesystem/functions/filectime.xml | 90 +-- reference/filesystem/functions/filegroup.xml | 60 +- reference/filesystem/functions/fileinode.xml | 52 +- reference/filesystem/functions/filemtime.xml | 78 +-- reference/filesystem/functions/fileowner.xml | 54 +- reference/filesystem/functions/fileperms.xml | 82 +-- reference/filesystem/functions/filesize.xml | 78 +-- reference/filesystem/functions/filetype.xml | 78 +-- reference/filesystem/functions/flock.xml | 220 ++++---- reference/filesystem/functions/fnmatch.xml | 96 ++-- reference/filesystem/functions/fopen.xml | 514 +++++++++--------- reference/filesystem/functions/fpassthru.xml | 122 ++--- reference/filesystem/functions/fputcsv.xml | 88 ++- reference/filesystem/functions/fread.xml | 164 +++--- reference/filesystem/functions/fscanf.xml | 112 ++-- reference/filesystem/functions/fseek.xml | 134 ++--- reference/filesystem/functions/fstat.xml | 72 +-- reference/filesystem/functions/ftell.xml | 80 +-- reference/filesystem/functions/ftruncate.xml | 74 +-- reference/filesystem/functions/fwrite.xml | 122 ++--- reference/filesystem/functions/glob.xml | 220 ++++---- reference/filesystem/functions/is-dir.xml | 72 +-- .../filesystem/functions/is-executable.xml | 70 +-- reference/filesystem/functions/is-file.xml | 68 +-- reference/filesystem/functions/is-link.xml | 50 +- .../filesystem/functions/is-readable.xml | 76 +-- .../filesystem/functions/is-uploaded-file.xml | 118 ++-- .../filesystem/functions/is-writable.xml | 82 +-- reference/filesystem/functions/lchgrp.xml | 64 +-- reference/filesystem/functions/lchown.xml | 62 +-- reference/filesystem/functions/link.xml | 52 +- reference/filesystem/functions/linkinfo.xml | 70 +-- reference/filesystem/functions/lstat.xml | 66 +-- reference/filesystem/functions/mkdir.xml | 122 ++--- .../functions/move-uploaded-file.xml | 124 ++--- .../filesystem/functions/parse-ini-file.xml | 186 +++---- reference/filesystem/functions/pathinfo.xml | 114 ++-- reference/filesystem/functions/pclose.xml | 58 +- reference/filesystem/functions/popen.xml | 116 ++-- reference/filesystem/functions/readfile.xml | 76 +-- reference/filesystem/functions/readlink.xml | 64 +-- reference/filesystem/functions/realpath.xml | 84 +-- reference/filesystem/functions/rename.xml | 110 ++-- reference/filesystem/functions/rewind.xml | 70 +-- reference/filesystem/functions/rmdir.xml | 64 +-- reference/filesystem/functions/stat.xml | 254 ++++----- reference/filesystem/functions/symlink.xml | 58 +- reference/filesystem/functions/tempnam.xml | 120 ++-- reference/filesystem/functions/tmpfile.xml | 78 +-- reference/filesystem/functions/touch.xml | 84 +-- reference/filesystem/functions/umask.xml | 80 +-- reference/filesystem/functions/unlink.xml | 60 +- 72 files changed, 3599 insertions(+), 3597 deletions(-) diff --git a/reference/filesystem/functions/basename.xml b/reference/filesystem/functions/basename.xml index fed4d3e95e..7925e91a2b 100644 --- a/reference/filesystem/functions/basename.xml +++ b/reference/filesystem/functions/basename.xml @@ -1,34 +1,34 @@ - + - - - basename - Returns filename component of path - - - Description - - stringbasename - stringpath - stringsuffix - - - Given a string containing a path to a file, this function will - return the base name of the file. - If the filename ends in suffix this will - also be cut off. - - - On Windows, both slash (/) and backslash - (\) are used as directory separator character. In - other environments, it is the forward slash - (/). - - - - <function>basename</function> example - + + + basename + Returns filename component of path + + + Description + + stringbasename + stringpath + stringsuffix + + + Given a string containing a path to a file, this function will + return the base name of the file. + If the filename ends in suffix this will + also be cut off. + + + On Windows, both slash (/) and backslash + (\) are used as directory separator character. In + other environments, it is the forward slash + (/). + + + + <function>basename</function> example + ]]> - - - - - - The suffix parameter was added in PHP 4.1.0. - - - - See also dirname. - - - + + + + + + The suffix parameter was added in PHP 4.1.0. + + + + See also dirname. + + + + - - - chgrp - Changes file group - - - Description - - boolchgrp - stringfilename - mixedgroup - - - Attempts to change the group of the file filename - to group (specified by name or number). Only the - superuser may change the group of a file arbitrarily; other users may - change the group of a file to any group of which that user is a member. - - - &return.success; - - ¬e.no-remote; - ¬e.sm.uidcheck; - - See also chown and - chmod. - - - + + + chgrp + Changes file group + + + Description + + boolchgrp + stringfilename + mixedgroup + + + Attempts to change the group of the file filename + to group (specified by name or number). Only the + superuser may change the group of a file arbitrarily; other users may + change the group of a file to any group of which that user is a member. + + + &return.success; + + ¬e.no-remote; + ¬e.sm.uidcheck; + + See also chown and + chmod. + + + + - - - chmod - Changes file mode - - - Description - - boolchmod - stringfilename - intmode - - - Attempts to change the mode of the file specified by - filename to that given in - mode. - - - Note that mode is not automatically - assumed to be an octal value, so strings (such as "g+w") will - not work properly. To ensure the expected operation, - you need to prefix mode with a zero (0): - - - - + + + chmod + Changes file mode + + + Description + + boolchmod + stringfilename + intmode + + + Attempts to change the mode of the file specified by + filename to that given in + mode. + + + Note that mode is not automatically + assumed to be an octal value, so strings (such as "g+w") will + not work properly. To ensure the expected operation, + you need to prefix mode with a zero (0): + + + + ]]> - - - - - The mode parameter consists of three octal - number components specifying access restrictions for the owner, - the user group in which the owner is in, and to everybody else in - this order. One component can be computed by adding up the needed - permissions for that target user base. Number 1 means that you - grant execute rights, number 2 means that you make the file - writeable, number 4 means that you make the file readable. Add - up these numbers to specify needed rights. You can also read more - about modes on Unix systems with 'man 1 chmod' and 'man 2 chmod'. - - - - + + + + + The mode parameter consists of three octal + number components specifying access restrictions for the owner, + the user group in which the owner is in, and to everybody else in + this order. One component can be computed by adding up the needed + permissions for that target user base. Number 1 means that you + grant execute rights, number 2 means that you make the file + writeable, number 4 means that you make the file readable. Add + up these numbers to specify needed rights. You can also read more + about modes on Unix systems with 'man 1 chmod' and 'man 2 chmod'. + + + + ]]> - - - - - &return.success; - - - - The current user is the user under which PHP runs. It is - probably not the same user you use for normal shell or FTP - access. - The mode can be changed only by user who owns the file on most systems. - - - ¬e.no-remote; - - - When &safemode; is enabled, PHP - checks whether the files or directories you are about to operate on have - the same UID (owner) as the script that is being executed. In addition, - you cannot set the SUID, SGID and sticky bits. - - - - See also chown and - chgrp. - - - + + + + + &return.success; + + + + The current user is the user under which PHP runs. It is + probably not the same user you use for normal shell or FTP + access. + The mode can be changed only by user who owns the file on most systems. + + + ¬e.no-remote; + + + When &safemode; is enabled, PHP + checks whether the files or directories you are about to operate on have + the same UID (owner) as the script that is being executed. In addition, + you cannot set the SUID, SGID and sticky bits. + + + + See also chown and + chgrp. + + + + - - - chown - Changes file owner - - - Description - - boolchown - stringfilename - mixeduser - - - Attempts to change the owner of the file filename - to user user (specified by name or number). Only - the superuser may change the owner of a file. - - - &return.success; - - ¬e.no-remote; - ¬e.sm.uidcheck; - - See also chmod. - - - + + + chown + Changes file owner + + + Description + + boolchown + stringfilename + mixeduser + + + Attempts to change the owner of the file filename + to user user (specified by name or number). Only + the superuser may change the owner of a file. + + + &return.success; + + ¬e.no-remote; + ¬e.sm.uidcheck; + + See also chmod. + + + + - - - clearstatcache - Clears file status cache - - - Description - - voidclearstatcache - - - - When you use stat, lstat, or - any of the other functions listed in the affected functions list (below), - PHP caches the information those functions return in order to provide - faster performance. However, in certain cases, you may want to clear the - cached information. For instance, if the same file is being checked - multiple times within a single script, and that file is in danger of - being removed or changed during that script's operation, you may elect to - clear the status cache. In these cases, you can use the - clearstatcache function to clear the information - that PHP caches about a file. - - - You should also note that PHP doesn't cache information about non-existent - files. So, if you call file_exists on a file that - doesn't exist, it will return &false; until you create the file. If you - create the file, it will return &true; even if you then delete the file. - - - - This function caches information about specific filenames, so you only - need to call clearstatcache if you are performing - multiple operations on the same filename and require the information - about that particular file to not be cached. - - - - Affected functions include stat, - lstat, - file_exists, - is_writable, - is_readable, - is_executable, - is_file, - is_dir, - is_link, - filectime, - fileatime, - filemtime, - fileinode, - filegroup, - fileowner, - filesize, - filetype, and - fileperms. - - - + + + clearstatcache + Clears file status cache + + + Description + + voidclearstatcache + + + + When you use stat, lstat, or + any of the other functions listed in the affected functions list (below), + PHP caches the information those functions return in order to provide + faster performance. However, in certain cases, you may want to clear the + cached information. For instance, if the same file is being checked + multiple times within a single script, and that file is in danger of + being removed or changed during that script's operation, you may elect to + clear the status cache. In these cases, you can use the + clearstatcache function to clear the information + that PHP caches about a file. + + + You should also note that PHP doesn't cache information about non-existent + files. So, if you call file_exists on a file that + doesn't exist, it will return &false; until you create the file. If you + create the file, it will return &true; even if you then delete the file. + + + + This function caches information about specific filenames, so you only + need to call clearstatcache if you are performing + multiple operations on the same filename and require the information + about that particular file to not be cached. + + + + Affected functions include stat, + lstat, + file_exists, + is_writable, + is_readable, + is_executable, + is_file, + is_dir, + is_link, + filectime, + fileatime, + filemtime, + fileinode, + filegroup, + fileowner, + filesize, + filetype, and + fileperms. + + + + - - - copy - Copies file - - - Description - - boolcopy - stringsource - stringdest - - - Makes a copy of the file source to - dest. &return.success; - - <function>copy</function> example - + + + copy + Copies file + + + Description + + boolcopy + stringsource + stringdest + + + Makes a copy of the file source to + dest. &return.success; + + <function>copy</function> example + ]]> - - - - - If you wish to move a file, use the rename function. - - - - As of PHP 4.3.0, both source and - dest may be URLs if the "fopen wrappers" - have been enabled. See fopen for more details. - If dest is a URL, the copy operation may - fail if the wrapper does not support overwriting of existing files. - - - - - If the destination file already exists, it will be overwritten. - - - - - Windows compatibility: If you copy a file with no size, - copy will return &false;, but the file will be correctly - copied. - - - - See also move_uploaded_file, - rename, and the section of the manual - about handling file - uploads. - - - + + + + + If you wish to move a file, use the rename function. + + + + As of PHP 4.3.0, both source and + dest may be URLs if the "fopen wrappers" + have been enabled. See fopen for more details. + If dest is a URL, the copy operation may + fail if the wrapper does not support overwriting of existing files. + + + + + If the destination file already exists, it will be overwritten. + + + + + Windows compatibility: If you copy a file with no size, + copy will return &false;, but the file will be correctly + copied. + + + + See also move_uploaded_file, + rename, and the section of the manual + about handling file + uploads. + + + + - - - delete - See unlink or unset - - - Description - - voiddelete - stringfile - - - This is a dummy manual entry to satisfy those people who are - looking for unlink or - unset in the wrong place. - - - See also unlink to delete files, - unset to delete variables. - - - + + + delete + See unlink or unset + + + Description + + voiddelete + stringfile + + + This is a dummy manual entry to satisfy those people who are + looking for unlink or + unset in the wrong place. + + + See also unlink to delete files, + unset to delete variables. + + + + - - - dirname - Returns directory name component of path - - - Description - - stringdirname - stringpath - - - Given a string containing a path to a file, this function will - return the name of the directory. - - - On Windows, both slash (/) and backslash - (\) are used as directory separator character. In - other environments, it is the forward slash - (/). - - - - <function>dirname</function> example - + + + dirname + Returns directory name component of path + + + Description + + stringdirname + stringpath + + + Given a string containing a path to a file, this function will + return the name of the directory. + + + On Windows, both slash (/) and backslash + (\) are used as directory separator character. In + other environments, it is the forward slash + (/). + + + + <function>dirname</function> example + ]]> - - - - - - In PHP 4.0.3, dirname was fixed to be - POSIX-compliant. Essentially, this means that if there are no - slashes in path , a dot - ('.') is returned, indicating the current - directory. Otherwise, the returned string is - path with any trailing - /component removed. Note that this means that - you will often get a slash or a dot back from - dirname in situations where the older - functionality would have given you the empty string. - - - - dirname has changed its behaviour in PHP 4.3.0. - Check the following examples: - - + + + + + + In PHP 4.0.3, dirname was fixed to be + POSIX-compliant. Essentially, this means that if there are no + slashes in path , a dot + ('.') is returned, indicating the current + directory. Otherwise, the returned string is + path with any trailing + /component removed. Note that this means that + you will often get a slash or a dot back from + dirname in situations where the older + functionality would have given you the empty string. + + + + dirname has changed its behaviour in PHP 4.3.0. + Check the following examples: + + ]]> - - - - - dirname has been binary safe since PHP 5.0.0 - - - See also basename, pathinfo, - and realpath. - - - + + + + + dirname has been binary safe since PHP 5.0.0 + + + See also basename, pathinfo, + and realpath. + + + + - - - disk_free_space - Returns available space in directory - - - Description - - floatdisk_free_space - stringdirectory - - - Given a string containing a directory, this function will return - the number of bytes available on the corresponding filesystem or - disk partition. - - - - <function>disk_free_space</function> example - + + + disk_free_space + Returns available space in directory + + + Description + + floatdisk_free_space + stringdirectory + + + Given a string containing a directory, this function will return + the number of bytes available on the corresponding filesystem or + disk partition. + + + + <function>disk_free_space</function> example + ]]> - - - - - ¬e.no-remote; + + + - - See also disk_total_space - - - + ¬e.no-remote; + + + See also disk_total_space + + + + - - - disk_total_space - Returns the total size of a directory - - - Description - - floatdisk_total_space - stringdirectory - - - Given a string containing a directory, this function will return - the total number of bytes on the corresponding filesystem or disk - partition. - - - - <function>disk_total_space</function> example - + + + disk_total_space + Returns the total size of a directory + + + Description + + floatdisk_total_space + stringdirectory + + + Given a string containing a directory, this function will return + the total number of bytes on the corresponding filesystem or disk + partition. + + + + <function>disk_total_space</function> example + ]]> - - - + + + - ¬e.no-remote; - - - See also disk_free_space - - - + ¬e.no-remote; + + + See also disk_free_space + + + + - - - fclose - Closes an open file pointer - - - Description - - boolfclose - resourcehandle - - - The file pointed to by handle is closed. - - - &return.success; - - - The file pointer must be valid, and must point to a file - successfully opened by fopen or - fsockopen. - - - - A simple <function>fclose</function> example - + + + fclose + Closes an open file pointer + + + Description + + boolfclose + resourcehandle + + + The file pointed to by handle is closed. + + + &return.success; + + + The file pointer must be valid, and must point to a file + successfully opened by fopen or + fsockopen. + + + + A simple <function>fclose</function> example + ]]> - - - - - + + + + + + - - - feof - Tests for end-of-file on a file pointer - - - Description - - boolfeof - resourcehandle - + + + feof + Tests for end-of-file on a file pointer + + + Description + + boolfeof + resourcehandle + + + Returns &true; if the file pointer is at EOF or an error occurs + (including socket timeout); otherwise returns &false;. + + + + If a connection opened by fsockopen wasn't closed + by the server, feof will wait until a timeout has + been reached to return &true;. The default timeout value is 60 seconds. + You may use stream_set_timeout to change this + value. + + + &fs.validfp.all; + - Returns &true; if the file pointer is at EOF or an error occurs - (including socket timeout); otherwise returns &false;. - - - - If a connection opened by fsockopen wasn't closed - by the server, feof will wait until a timeout has - been reached to return &true;. The default timeout value is 60 seconds. - You may use stream_set_timeout to change this - value. - - - &fs.validfp.all; - - - If passed file pointer is not valid you may get an infinite loop, because - EOF fails to return TRUE. - - <function>feof</function> example with an invalid file pointer - + If passed file pointer is not valid you may get an infinite loop, because + EOF fails to return TRUE. + + <function>feof</function> example with an invalid file pointer + ]]> - - - - - - + + + + + + + - - - fflush - Flushes the output to a file - - - Description - - boolfflush - resourcehandle - - - This function forces a write of all buffered output to the - resource pointed to by the file handle handle. - &return.success; - - &fs.validfp.all; - - + + + fflush + Flushes the output to a file + + + Description + + boolfflush + resourcehandle + + + This function forces a write of all buffered output to the + resource pointed to by the file handle handle. + &return.success; + + &fs.validfp.all; + + + - - - fgetc - Gets character from file pointer - - - Description - - stringfgetc - resourcehandle - - - Returns a string containing a single character read from the - file pointed to by handle. - Returns &false; on EOF. - + + + fgetc + Gets character from file pointer + + + Description + + stringfgetc + resourcehandle + + + Returns a string containing a single character read from the + file pointed to by handle. + Returns &false; on EOF. + - &fs.validfp.all; - &return.falseproblem; - - - - A <function>fgetc</function> example - + &fs.validfp.all; + &return.falseproblem; + + + + A <function>fgetc</function> example + ]]> - - - - - ¬e.bin-safe; + + + - - See also fread, fopen, - popen, fsockopen, and - fgets. - - - + ¬e.bin-safe; + + + See also fread, fopen, + popen, fsockopen, and + fgets. + + + + - - - fgetcsv - Gets line from file pointer and parse for CSV fields - - - Description - - arrayfgetcsv - resourcehandle - intlength - stringdelimiter - stringenclosure - + + + fgetcsv + Gets line from file pointer and parse for CSV fields + + + Description + + arrayfgetcsv + resourcehandle + intlength + stringdelimiter + stringenclosure + - - - - handle - - - A valid file pointer to a file successfully opened by fopen, - popen, or fsockopen. - - - - - length (Optional) - - - Must be greater than the longest line (in characters) to be found in the CSV file - (allowing for trailing line-end characters). It became optional in PHP 5. Omitting - this parameter (or setting it to 0 in PHP 5.0.4 and later) the maximum line length - is not limited, which is slightly slower. - - - - - delimiter (Optional) - - - Set the field delimiter (one character only). Defaults as a comma. - - - - - enclosure (Optional) - - - Set the field enclosure character (one character only). Defaults as a double quotation mark. Added in PHP 4.3.0. - - - - - + + + + handle + + + A valid file pointer to a file successfully opened by fopen, + popen, or fsockopen. + + + + + length (Optional) + + + Must be greater than the longest line (in characters) to be found in the CSV file + (allowing for trailing line-end characters). It became optional in PHP 5. Omitting + this parameter (or setting it to 0 in PHP 5.0.4 and later) the maximum line length + is not limited, which is slightly slower. + + + + + delimiter (Optional) + + + Set the field delimiter (one character only). Defaults as a comma. + + + + + enclosure (Optional) + + + Set the field enclosure character (one character only). Defaults as a double quotation mark. Added in PHP 4.3.0. + + + + + - - Similar to fgets except that - fgetcsv parses the line it reads for fields - in CSV format and returns an array containing - the fields read. - - - fgetcsv returns &false; on error, including - end of file. - - - - A blank line in a CSV file will be returned as an array - comprising a single null field, and will not be treated - as an error. - - - - - Read and print the entire contents of a CSV file - + + Similar to fgets except that + fgetcsv parses the line it reads for fields + in CSV format and returns an array containing + the fields read. + + + fgetcsv returns &false; on error, including + end of file. + + + + A blank line in a CSV file will be returned as an array + comprising a single null field, and will not be treated + as an error. + + + + + Read and print the entire contents of a CSV file + ]]> - - - - - fgetcsv has been binary safe since PHP 4.3.5 - - - - Locale setting is taken into account by this function. If - LANG is e.g. en_US.UTF-8, files in - one-byte encoding are read wrong by this function. - - - ¬e.line-endings; - - See also explode, file, - pack and fputcsv. - - - + + + + + fgetcsv has been binary safe since PHP 4.3.5 + + + + Locale setting is taken into account by this function. If + LANG is e.g. en_US.UTF-8, files in + one-byte encoding are read wrong by this function. + + + ¬e.line-endings; + + See also explode, file, + pack and fputcsv. + + + + - - - fgets - Gets line from file pointer - - - Description - - stringfgets - resourcehandle - intlength - - - Returns a string of up to length - 1 bytes read from - the file pointed to by handle. Reading ends when - length - 1 bytes have been read, on a newline (which is - included in the return value), or on EOF (whichever comes first). If no length - is specified, it will keep reading from the stream until it reaches - the end of the line. - - - If an error occurs, returns &false;. - - - Common Pitfalls: - - - People used to the 'C' semantics of fgets - should note the difference in how EOF is returned. - - - &fs.validfp.all; + + + fgets + Gets line from file pointer + + + Description + + stringfgets + resourcehandle + intlength + + + Returns a string of up to length - 1 bytes read from + the file pointed to by handle. Reading ends when + length - 1 bytes have been read, on a newline (which is + included in the return value), or on EOF (whichever comes first). If no length + is specified, it will keep reading from the stream until it reaches + the end of the line. + + + If an error occurs, returns &false;. + + + Common Pitfalls: + + + People used to the 'C' semantics of fgets + should note the difference in how EOF is returned. + - - A simple example follows: - - Reading a file line by line - + &fs.validfp.all; + + + A simple example follows: + + Reading a file line by line + ]]> - - - - - - The length parameter became optional in PHP - 4.2.0. Until PHP 4.3.0, omitting it would assume 1024 as the line length. - If the majority of the lines in the file are all larger than 8KB, - it is more resource efficient for your script to specify the maximum - line length. - - - - - This function is binary safe as of PHP 4.3. Earlier versions - were not binary safe. - - - ¬e.line-endings; - - See also fgetss - fread, - fgetc, - stream_get_line, - fopen, - popen, - fsockopen, and - stream_set_timeout. - - - + + + + + + The length parameter became optional in PHP + 4.2.0. Until PHP 4.3.0, omitting it would assume 1024 as the line length. + If the majority of the lines in the file are all larger than 8KB, + it is more resource efficient for your script to specify the maximum + line length. + + + + + This function is binary safe as of PHP 4.3. Earlier versions + were not binary safe. + + + ¬e.line-endings; + + See also fgetss + fread, + fgetc, + stream_get_line, + fopen, + popen, + fsockopen, and + stream_set_timeout. + + + + - - - fgetss - Gets line from file pointer and strip HTML tags - - - Description - - stringfgetss - resourcehandle - intlength - stringallowable_tags - + + + fgetss + Gets line from file pointer and strip HTML tags + + + Description + + stringfgetss + resourcehandle + intlength + stringallowable_tags + + + Identical to fgets, except that fgetss + attempts to strip any HTML and PHP tags from the text it + reads. + + + You can use the optional third parameter to specify tags which + should not be stripped. + - Identical to fgets, except that fgetss - attempts to strip any HTML and PHP tags from the text it - reads. + allowable_tags was added in PHP 3.0.13, + PHP 4.0.0. - - You can use the optional third parameter to specify tags which - should not be stripped. - - - allowable_tags was added in PHP 3.0.13, - PHP 4.0.0. - - - - - Parameter length is optional since PHP 5. - - ¬e.line-endings; - - See also fgets, fopen, - fsockopen, popen, and - strip_tags. - - - + + + + Parameter length is optional since PHP 5. + + ¬e.line-endings; + + See also fgets, fopen, + fsockopen, popen, and + strip_tags. + + + + - - - file_exists - Checks whether a file or directory exists - - - Description - - boolfile_exists - stringfilename - - - Returns &true; if the file or directory specified by - filename exists; &false; otherwise. - - - On windows, use //computername/share/filename or - \\computername\share\filename to check files on - network shares. - - - - Testing whether a file exists - + + + file_exists + Checks whether a file or directory exists + + + Description + + boolfile_exists + stringfilename + + + Returns &true; if the file or directory specified by + filename exists; &false; otherwise. + + + On windows, use //computername/share/filename or + \\computername\share\filename to check files on + network shares. + + + + Testing whether a file exists + ]]> - - - + + + - ¬e.clearstatcache; + ¬e.clearstatcache; - &tip.fopen-wrapper.stat; - - - - This function returns &false; for files inaccessible due to safe mode restrictions. However these - files still can be included if - they are located in safe_mode_include_dir. - - + &tip.fopen-wrapper.stat; - - See also is_readable, is_writable, - is_file and file. - - - + + + This function returns &false; for files inaccessible due to safe mode restrictions. However these + files still can be included if + they are located in safe_mode_include_dir. + + + + + See also is_readable, is_writable, + is_file and file. + + + + - - - file - Reads entire file into an array - - - Description - - arrayfile - stringfilename - intuse_include_path - resourcecontext - - - Identical to file_get_contents, except that - file returns the file in an array. Each - element of the array corresponds to a line in the file, with the - newline still attached. Upon failure, file - returns &false;. - - - You can use the optional use_include_path parameter - and set it to "1", if you want to search for the file in the include_path, too. - - - - + + + file + Reads entire file into an array + + + Description + + arrayfile + stringfilename + intuse_include_path + resourcecontext + + + Identical to file_get_contents, except that + file returns the file in an array. Each + element of the array corresponds to a line in the file, with the + newline still attached. Upon failure, file + returns &false;. + + + You can use the optional use_include_path parameter + and set it to "1", if you want to search for the file in the include_path, too. + + + + $line) { $html = implode('', file('http://www.example.com/')); ?> ]]> - - - - &tip.fopen-wrapper; - - - Each line in the resulting array will include the line ending, so you - still need to use rtrim if you do not want the line - ending present. - - - ¬e.line-endings; - - - As of PHP 4.3.0 you can use file_get_contents to - return the contents of a file as a string. - - - In PHP 4.3.0 file became binary safe. - - - ¬e.context-support; - &warn.ssl-non-standard; - - See also readfile, - fopen, fsockopen, - popen, file_get_contents, - include, and - stream_context_create - - - + + + + &tip.fopen-wrapper; + + + Each line in the resulting array will include the line ending, so you + still need to use rtrim if you do not want the line + ending present. + + + ¬e.line-endings; + + + As of PHP 4.3.0 you can use file_get_contents to + return the contents of a file as a string. + + + In PHP 4.3.0 file became binary safe. + + + ¬e.context-support; + &warn.ssl-non-standard; + + See also readfile, + fopen, fsockopen, + popen, file_get_contents, + include, and + stream_context_create + + + + - - - fileatime - Gets last access time of file - - - Description - - intfileatime - stringfilename - - - Returns the time the file was last accessed, or &false; in case of - an error. The time is returned as a Unix timestamp. - - - Note: The atime of a file is supposed to change whenever - the data blocks of a file are being read. This can be - costly performance-wise when an application regularly - accesses a very large number of files or directories. Some - Unix filesystems can be mounted with atime updates disabled - to increase the performance of such applications; USENET - news spools are a common example. On such filesystems - this function will be useless. - - - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; + + + fileatime + Gets last access time of file + + + Description + + intfileatime + stringfilename + + + Returns the time the file was last accessed, or &false; in case of + an error. The time is returned as a Unix timestamp. + + + Note: The atime of a file is supposed to change whenever + the data blocks of a file are being read. This can be + costly performance-wise when an application regularly + accesses a very large number of files or directories. Some + Unix filesystems can be mounted with atime updates disabled + to increase the performance of such applications; USENET + news spools are a common example. On such filesystems + this function will be useless. + - - - <function>fileatime</function> example - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + + <function>fileatime</function> example + ]]> - - - - - See also filemtime, - fileinode, and - date. - - - + + + + + See also filemtime, + fileinode, and + date. + + + + - - - filectime - Gets inode change time of file - - - Description - - intfilectime - stringfilename - - - Returns the time the file was last changed, or &false; in case of - an error. The time is returned as a Unix timestamp. - - - Note: In most Unix filesystems, a file is considered - changed when its inode data is changed; that is, when - the permissions, owner, group, or other metadata - from the inode is updated. See also - filemtime (which is what you want to use - when you want to create "Last Modified" footers on web pages) and - fileatime. - - Note also that in some Unix texts the ctime of a file is - referred to as being the creation time of the file. This is wrong. - There is no creation time for Unix files in most Unix filesystems. - - - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; + + + filectime + Gets inode change time of file + + + Description + + intfilectime + stringfilename + + + Returns the time the file was last changed, or &false; in case of + an error. The time is returned as a Unix timestamp. + + + Note: In most Unix filesystems, a file is considered + changed when its inode data is changed; that is, when + the permissions, owner, group, or other metadata + from the inode is updated. See also + filemtime (which is what you want to use + when you want to create "Last Modified" footers on web pages) and + fileatime. + + Note also that in some Unix texts the ctime of a file is + referred to as being the creation time of the file. This is wrong. + There is no creation time for Unix files in most Unix filesystems. + - - - A <function>filectime</function> example - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + + A <function>filectime</function> example + ]]> - - - - - See also filemtime - - - + + + + + See also filemtime + + + + - - - filegroup - Gets file group - - - Description - - intfilegroup - stringfilename - - - Returns the group ID of the file, or &false; in case - of an error. The group ID is returned in numerical format, use - posix_getgrgid to resolve it to a group name. - Upon failure, &false; is returned along with an error of level - E_WARNING. - - - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; - - - See also fileowner, and - safe_mode_gid. - - - + + + filegroup + Gets file group + + + Description + + intfilegroup + stringfilename + + + Returns the group ID of the file, or &false; in case + of an error. The group ID is returned in numerical format, use + posix_getgrgid to resolve it to a group name. + Upon failure, &false; is returned along with an error of level + E_WARNING. + + + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + See also fileowner, and + safe_mode_gid. + + + + - - - fileinode - Gets file inode - - - Description - - intfileinode - stringfilename - - - Returns the inode number of the file, or &false; in case of an - error. - - - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; - - - See also stat - - - + + + fileinode + Gets file inode + + + Description + + intfileinode + stringfilename + + + Returns the inode number of the file, or &false; in case of an + error. + + + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + See also stat + + + + - - - filemtime - Gets file modification time - - - Description - - intfilemtime - stringfilename - - - Returns the time the file was last modified, or &false; in case of - an error. The time is returned as a Unix timestamp, which is - suitable for the date function. - - - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; + + + filemtime + Gets file modification time + + + Description + + intfilemtime + stringfilename + + + Returns the time the file was last modified, or &false; in case of + an error. The time is returned as a Unix timestamp, which is + suitable for the date function. + - - This function returns the time when the data - blocks of a file were being written to, that is, the time - when the content of the file was changed. - - - - <function>filemtime</function> example - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + This function returns the time when the data + blocks of a file were being written to, that is, the time + when the content of the file was changed. + + + + <function>filemtime</function> example + ]]> - - - - - See also filectime, stat, - touch, and getlastmod. - - - + + + + + See also filectime, stat, + touch, and getlastmod. + + + + - - - fileowner - Gets file owner - - - Description - - intfileowner - stringfilename - - - Returns the user ID of the owner of the file, or &false; in case of - an error. The user ID is returned in numerical format, use - posix_getpwuid to resolve it to a username. - - - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; - - - See also stat - + + + fileowner + Gets file owner + + + Description + + intfileowner + stringfilename + + + Returns the user ID of the owner of the file, or &false; in case of + an error. The user ID is returned in numerical format, use + posix_getpwuid to resolve it to a username. + - - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + See also stat + + + + + - - - fileperms - Gets file permissions - - - Description - - intfileperms - stringfilename - - - Returns the permissions on the file, or &false; in case of an error. - - ¬e.clearstatcache; - &tip.fopen-wrapper.stat; - - Display permissions as an octal value - + + + fileperms + Gets file permissions + + + Description + + intfileperms + stringfilename + + + Returns the permissions on the file, or &false; in case of an error. + + ¬e.clearstatcache; + &tip.fopen-wrapper.stat; + + Display permissions as an octal value + ]]> - - This would produce the output: - + + + This would produce the output: + + - - - - Display full permissions - + + + + Display full permissions + ]]> - - This would produce the output: - + + + This would produce the output: + + - - - - See also is_readable, - and stat - - - + + + + See also is_readable, + and stat + + + + - - - filesize - Gets file size - - - Description - - intfilesize - stringfilename - - - Returns the size of the file in bytes, or &false; (and generates an error - of level E_WARNING) in case of an error. - - - - Because PHP's integer type is signed and many platforms use 32bit integers, - filesize may return unexpected results for files which - are larger than 2GB. For files between 2GB and 4GB in size this can usually - be overcome by using sprintf("%u", filesize($file)). - - - - ¬e.clearstatcache; + + + filesize + Gets file size + + + Description + + intfilesize + stringfilename + + + Returns the size of the file in bytes, or &false; (and generates an error + of level E_WARNING) in case of an error. + + + + Because PHP's integer type is signed and many platforms use 32bit integers, + filesize may return unexpected results for files which + are larger than 2GB. For files between 2GB and 4GB in size this can usually + be overcome by using sprintf("%u", filesize($file)). + + - &tip.fopen-wrapper.stat; + ¬e.clearstatcache; - - - <function>filesize</function> example - + &tip.fopen-wrapper.stat; + + + + <function>filesize</function> example + ]]> - - - - - See also file_exists - - - + + + + + See also file_exists + + + + - - - filetype - Gets file type - - - Description - - stringfiletype - stringfilename - - - Returns the type of the file. Possible values are fifo, char, - dir, block, link, file, and unknown. - - - Returns &false; if an error occurs. filetype will also - produce an E_NOTICE message if the stat call fails - or if the file type is unknown. - - - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; + + + filetype + Gets file type + + + Description + + stringfiletype + stringfilename + + + Returns the type of the file. Possible values are fifo, char, + dir, block, link, file, and unknown. + + + Returns &false; if an error occurs. filetype will also + produce an E_NOTICE message if the stat call fails + or if the file type is unknown. + - - - <function>filetype</function> example - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + + <function>filetype</function> example + ]]> - - - - - See also is_dir, is_file, - is_link, file_exists, - stat, and mime_content_type. - - - + + + + + See also is_dir, is_file, + is_link, file_exists, + stat, and mime_content_type. + + + + - - - flock - Portable advisory file locking - - - Description - - boolflock - resourcehandle - intoperation - intwouldblock - - - PHP supports a portable way of locking complete files in an - advisory way (which means all accessing programs have to use the - same way of locking or it will not work). - - - - flock is mandatory under Windows. - - - - flock operates on handle - which must be an open file - pointer. operation is one of the following - values: - - - - - - To acquire a shared lock (reader), set - operation to LOCK_SH (set to 1 prior to - PHP 4.0.1). - - - - - To acquire an exclusive lock (writer), set - operation to LOCK_EX (set to 2 prior to - PHP 4.0.1). - - - - - To release a lock (shared or exclusive), set - operation to LOCK_UN (set to 3 prior to - PHP 4.0.1). - - - - - If you don't want flock to block while - locking, add LOCK_NB (4 prior to PHP 4.0.1) to - operation. - - - - - - flock allows you to perform a simple - reader/writer model which can be used on virtually every platform - (including most Unix derivatives and even Windows). The optional third - argument is set to &true; if the lock would block (EWOULDBLOCK - errno condition). The lock is released also by fclose - (which is also called automatically when script finished). - - - &return.success; - - - - <function>flock</function> example - + + + flock + Portable advisory file locking + + + Description + + boolflock + resourcehandle + intoperation + intwouldblock + + + PHP supports a portable way of locking complete files in an + advisory way (which means all accessing programs have to use the + same way of locking or it will not work). + + + + flock is mandatory under Windows. + + + + flock operates on handle + which must be an open file + pointer. operation is one of the following + values: + + + + + + To acquire a shared lock (reader), set + operation to LOCK_SH (set to 1 prior to + PHP 4.0.1). + + + + + To acquire an exclusive lock (writer), set + operation to LOCK_EX (set to 2 prior to + PHP 4.0.1). + + + + + To release a lock (shared or exclusive), set + operation to LOCK_UN (set to 3 prior to + PHP 4.0.1). + + + + + If you don't want flock to block while + locking, add LOCK_NB (4 prior to PHP 4.0.1) to + operation. + + + + + + flock allows you to perform a simple + reader/writer model which can be used on virtually every platform + (including most Unix derivatives and even Windows). The optional third + argument is set to &true; if the lock would block (EWOULDBLOCK + errno condition). The lock is released also by fclose + (which is also called automatically when script finished). + + + &return.success; + + + + <function>flock</function> example + ]]> - - - - - - Because flock requires a file pointer, you may have - to use a special lock file to protect access to a file that you intend - to truncate by opening it in write mode (with a "w" or "w+" argument to - fopen). - - - - - flock will not work on NFS and many other networked - file systems. Check your operating system documentation for more - details. - - - On some operating systems flock is implemented at - the process level. When using a multithreaded server API like ISAPI you - may not be able to rely on flock to protect files - against other PHP scripts running in parallel threads of the same server - instance! - - - flock is not supported on antiquated filesystems like - FAT and its derivates and will therefore always - return &false; under this environments (this is especially true for - Windows 98 users). - - - - + + + + + + Because flock requires a file pointer, you may have + to use a special lock file to protect access to a file that you intend + to truncate by opening it in write mode (with a "w" or "w+" argument to + fopen). + + + + + flock will not work on NFS and many other networked + file systems. Check your operating system documentation for more + details. + + + On some operating systems flock is implemented at + the process level. When using a multithreaded server API like ISAPI you + may not be able to rely on flock to protect files + against other PHP scripts running in parallel threads of the same server + instance! + + + flock is not supported on antiquated filesystems like + FAT and its derivates and will therefore always + return &false; under this environments (this is especially true for + Windows 98 users). + + + + - - - fnmatch - Match filename against a pattern - - - Description - - boolfnmatch - stringpattern - stringstring - intflags - - - fnmatch checks if the passed string would - match the given shell wildcard pattern. - - - This is especially useful for filenames, but may also be used on regular strings. - The average user may be used to shell patterns or at least in their simplest form - to '?' and '*' wildcards so using - fnmatch instead of ereg or - preg_match for frontend search expression input may be - way more convenient for non-programming users. - - - - Checking a color name against a shell wildcard pattern. - - + + + + fnmatch + Match filename against a pattern + + + Description + + boolfnmatch + stringpattern + stringstring + intflags + + + fnmatch checks if the passed string would + match the given shell wildcard pattern. + + + This is especially useful for filenames, but may also be used on regular strings. + The average user may be used to shell patterns or at least in their simplest form + to '?' and '*' wildcards so using + fnmatch instead of ereg or + preg_match for frontend search expression input may be + way more convenient for non-programming users. + + + + Checking a color name against a shell wildcard pattern. + + ]]> - - - - - For now this function is not available on Windows or other non-POSIX - compliant systems. - - - - See also glob, - ereg, - preg_match - and the Unix manpage on fnmatch(3) for flag names - (as long as they are not documented here ). - - - + + + + + For now this function is not available on Windows or other non-POSIX + compliant systems. + + + + See also glob, + ereg, + preg_match + and the Unix manpage on fnmatch(3) for flag names + (as long as they are not documented here ). + + + + - - - fopen - Opens file or URL - - - Description - - resourcefopen - stringfilename - stringmode - booluse_include_path - resourcecontext - - - fopen binds a named resource, specified - by filename, to a stream. If - filename is of the form "scheme://...", - it is assumed to be a URL and PHP will search for a protocol - handler (also known as a wrapper) for that scheme. If no - wrappers for that protocol are registered, PHP will emit - a notice to help you track potential problems in your script - and then continue as though filename - specifies a regular file. - - - If PHP has decided that filename specifies - a local file, then it will try to open a stream on that file. - The file must be accessible to PHP, so you need to ensure that - the file access permissions allow this access. - If you have enabled &safemode;, - or open_basedir further - restrictions may apply. - - - If PHP has decided that filename specifies - a registered protocol, and that protocol is registered as a - network URL, PHP will check to make sure that - allow_url_fopen is - enabled. If it is switched off, PHP will emit a warning and - the fopen call will fail. - - - - The list of supported protocols can be found in . - Some protocols (also referred to as wrappers) support - context and/or &php.ini; options. - Refer to the specific page for the protocol in use for a list of options - which can be set. (e.g. &php.ini; value - user_agent used by the http wrapper). - - - ¬e.context-support; - - - As of PHP 4.3.2, the default mode is set to binary for all - platforms that distinguish between binary and text mode. If you are - having problems with your scripts after upgrading, try using the - 't' flag as a workaround until you have made your - script more portable as mentioned below. - - - - The mode parameter specifies the type of access - you require to the stream. It may be any of the following: - - - A list of possible modes for <function>fopen</function> - using <parameter>mode</parameter> - - - - - mode - Description - - - - - 'r' - - Open for reading only; place the file pointer at the - beginning of the file. - - - - 'r+' - - Open for reading and writing; place the file pointer at - the beginning of the file. - - - - 'w' - - Open for writing only; place the file pointer at the - beginning of the file and truncate the file to zero length. - If the file does not exist, attempt to create it. - - - - 'w+' - - Open for reading and writing; place the file pointer at - the beginning of the file and truncate the file to zero - length. If the file does not exist, attempt to create it. - - - - 'a' - - Open for writing only; place the file pointer at the end of - the file. If the file does not exist, attempt to create it. - - - - 'a+' - - Open for reading and writing; place the file pointer at - the end of the file. If the file does not exist, attempt to - create it. - - - - 'x' - - Create and open for writing only; place the file pointer at the - beginning of the file. If the file already exists, the - fopen call will fail by returning &false; and - generating an error of level E_WARNING. If - the file does not exist, attempt to create it. This is equivalent - to specifying O_EXCL|O_CREAT flags for the - underlying open(2) system call. This option is - supported in PHP 4.3.2 and later, and only works for local files. - - - - 'x+' - - Create and open for reading and writing; place the file pointer at - the beginning of the file. If the file already exists, the - fopen call will fail by returning &false; and - generating an error of level E_WARNING. If - the file does not exist, attempt to create it. This is equivalent - to specifying O_EXCL|O_CREAT flags for the - underlying open(2) system call. This option is - supported in PHP 4.3.2 and later, and only works for local files. - - - - -
-
- - - Different operating system families have different line-ending - conventions. When you write a text file and want to insert a line - break, you need to use the correct line-ending character(s) for your - operating system. Unix based systems use \n as the - line ending character, Windows based systems use \r\n - as the line ending characters and Macintosh based systems use - \r as the line ending character. - - - If you use the wrong line ending characters when writing your files, you - might find that other applications that open those files will "look - funny". - - - Windows offers a text-mode translation flag ('t') - which will transparently translate \n to - \r\n when working with the file. In contrast, you - can also use 'b' to force binary mode, which will not - translate your data. To use these flags, specify either - 'b' or 't' as the last character - of the mode parameter. - - - The default translation mode depends on the SAPI and version of PHP that - you are using, so you are encouraged to always specify the appropriate - flag for portability reasons. You should use the 't' - mode if you are working with plain-text files and you use - \n to delimit your line endings in your script, but - expect your files to be readable with applications such as notepad. You - should use the 'b' in all other cases. - - - If you do not specify the 'b' flag when working with binary files, you - may experience strange problems with your data, including broken image - files and strange problems with \r\n characters. - - - - - For portability, it is strongly recommended that you always - use the 'b' flag when opening files with fopen. - - - - - Again, for portability, it is also strongly recommended that - you re-write code that uses or relies upon the 't' - mode so that it uses the correct line endings and - 'b' mode instead. - - - - The optional third use_include_path parameter - can be set to '1' or &true; if you want to search for the file in - the include_path, too. - - - If the open fails, the function returns &false; and an error of - level E_WARNING is generated. You may use - @ to - suppress this warning. - - - - <function>fopen</function> examples - + + + fopen + Opens file or URL + + + Description + + resourcefopen + stringfilename + stringmode + booluse_include_path + resourcecontext + + + fopen binds a named resource, specified + by filename, to a stream. If + filename is of the form "scheme://...", + it is assumed to be a URL and PHP will search for a protocol + handler (also known as a wrapper) for that scheme. If no + wrappers for that protocol are registered, PHP will emit + a notice to help you track potential problems in your script + and then continue as though filename + specifies a regular file. + + + If PHP has decided that filename specifies + a local file, then it will try to open a stream on that file. + The file must be accessible to PHP, so you need to ensure that + the file access permissions allow this access. + If you have enabled &safemode;, + or open_basedir further + restrictions may apply. + + + If PHP has decided that filename specifies + a registered protocol, and that protocol is registered as a + network URL, PHP will check to make sure that + allow_url_fopen is + enabled. If it is switched off, PHP will emit a warning and + the fopen call will fail. + + + + The list of supported protocols can be found in . + Some protocols (also referred to as wrappers) support + context and/or &php.ini; options. + Refer to the specific page for the protocol in use for a list of options + which can be set. (e.g. &php.ini; value + user_agent used by the http wrapper). + + + ¬e.context-support; + + + As of PHP 4.3.2, the default mode is set to binary for all + platforms that distinguish between binary and text mode. If you are + having problems with your scripts after upgrading, try using the + 't' flag as a workaround until you have made your + script more portable as mentioned below. + + + + The mode parameter specifies the type of access + you require to the stream. It may be any of the following: + + + A list of possible modes for <function>fopen</function> + using <parameter>mode</parameter> + + + + + mode + Description + + + + + 'r' + + Open for reading only; place the file pointer at the + beginning of the file. + + + + 'r+' + + Open for reading and writing; place the file pointer at + the beginning of the file. + + + + 'w' + + Open for writing only; place the file pointer at the + beginning of the file and truncate the file to zero length. + If the file does not exist, attempt to create it. + + + + 'w+' + + Open for reading and writing; place the file pointer at + the beginning of the file and truncate the file to zero + length. If the file does not exist, attempt to create it. + + + + 'a' + + Open for writing only; place the file pointer at the end of + the file. If the file does not exist, attempt to create it. + + + + 'a+' + + Open for reading and writing; place the file pointer at + the end of the file. If the file does not exist, attempt to + create it. + + + + 'x' + + Create and open for writing only; place the file pointer at the + beginning of the file. If the file already exists, the + fopen call will fail by returning &false; and + generating an error of level E_WARNING. If + the file does not exist, attempt to create it. This is equivalent + to specifying O_EXCL|O_CREAT flags for the + underlying open(2) system call. This option is + supported in PHP 4.3.2 and later, and only works for local files. + + + + 'x+' + + Create and open for reading and writing; place the file pointer at + the beginning of the file. If the file already exists, the + fopen call will fail by returning &false; and + generating an error of level E_WARNING. If + the file does not exist, attempt to create it. This is equivalent + to specifying O_EXCL|O_CREAT flags for the + underlying open(2) system call. This option is + supported in PHP 4.3.2 and later, and only works for local files. + + + + +
+
+ + + Different operating system families have different line-ending + conventions. When you write a text file and want to insert a line + break, you need to use the correct line-ending character(s) for your + operating system. Unix based systems use \n as the + line ending character, Windows based systems use \r\n + as the line ending characters and Macintosh based systems use + \r as the line ending character. + + + If you use the wrong line ending characters when writing your files, you + might find that other applications that open those files will "look + funny". + + + Windows offers a text-mode translation flag ('t') + which will transparently translate \n to + \r\n when working with the file. In contrast, you + can also use 'b' to force binary mode, which will not + translate your data. To use these flags, specify either + 'b' or 't' as the last character + of the mode parameter. + + + The default translation mode depends on the SAPI and version of PHP that + you are using, so you are encouraged to always specify the appropriate + flag for portability reasons. You should use the 't' + mode if you are working with plain-text files and you use + \n to delimit your line endings in your script, but + expect your files to be readable with applications such as notepad. You + should use the 'b' in all other cases. + + + If you do not specify the 'b' flag when working with binary files, you + may experience strange problems with your data, including broken image + files and strange problems with \r\n characters. + + + + + For portability, it is strongly recommended that you always + use the 'b' flag when opening files with fopen. + + + + + Again, for portability, it is also strongly recommended that + you re-write code that uses or relies upon the 't' + mode so that it uses the correct line endings and + 'b' mode instead. + + + + The optional third use_include_path parameter + can be set to '1' or &true; if you want to search for the file in + the include_path, too. + + + If the open fails, the function returns &false; and an error of + level E_WARNING is generated. You may use + @ to + suppress this warning. + + + + <function>fopen</function> examples + ]]> - - - - - If you are experiencing problems with reading and writing to - files and you're using the server module version of PHP, remember - to make sure that the files and directories you're using are - accessible to the server process. - - - On the Windows platform, be careful to escape any backslashes - used in the path to the file, or use forward slashes. - - + +
+
+ + If you are experiencing problems with reading and writing to + files and you're using the server module version of PHP, remember + to make sure that the files and directories you're using are + accessible to the server process. + + + On the Windows platform, be careful to escape any backslashes + used in the path to the file, or use forward slashes. + + ]]> - - - - &warn.ssl-non-standard; - ¬e.sm.uidcheck.dir; - - See also , - fclose, - fgets, - fread, - fwrite, - fsockopen, - file, - file_exists, - is_readable, - stream_set_timeout, - popen, and - stream_context_create. - -
-
+ + + + &warn.ssl-non-standard; + ¬e.sm.uidcheck.dir; + + See also , + fclose, + fgets, + fread, + fwrite, + fsockopen, + file, + file_exists, + is_readable, + stream_set_timeout, + popen, and + stream_context_create. + + + + - - - fpassthru - Output all remaining data on a file pointer - - - Description - - intfpassthru - resourcehandle - - - Reads to EOF on the given file pointer from the current position and - writes the results to the output buffer. - - - If an error occurs, fpassthru returns - &false;. Otherwise, fpassthru returns - the number of characters read from handle - and passed through to the output. - - &fs.validfp.all; - - You may need to call rewind to reset the file - pointer to the beginning of the file if you have already written data - to the file. - - - If you just want to dump the contents of a file to the output buffer, - without first modifying it or seeking to a particular offset, you may - want to use the readfile, which saves you - the fopen call. - - - - When using fpassthru on a binary file on Windows - systems, you should make sure to open the file in binary mode by - appending a b to the mode used in the call to - fopen. - - - You are encouraged to use the b flag when dealing - with binary files, even if your system does not require it, so that - your scripts will be more portable. - - - - - Using <function>fpassthru</function> with binary files - + + + fpassthru + Output all remaining data on a file pointer + + + Description + + intfpassthru + resourcehandle + + + Reads to EOF on the given file pointer from the current position and + writes the results to the output buffer. + + + If an error occurs, fpassthru returns + &false;. Otherwise, fpassthru returns + the number of characters read from handle + and passed through to the output. + + &fs.validfp.all; + + You may need to call rewind to reset the file + pointer to the beginning of the file if you have already written data + to the file. + + + If you just want to dump the contents of a file to the output buffer, + without first modifying it or seeking to a particular offset, you may + want to use the readfile, which saves you + the fopen call. + + + + When using fpassthru on a binary file on Windows + systems, you should make sure to open the file in binary mode by + appending a b to the mode used in the call to + fopen. + + + You are encouraged to use the b flag when dealing + with binary files, even if your system does not require it, so that + your scripts will be more portable. + + + + + Using <function>fpassthru</function> with binary files + ]]> - - - - - See also readfile, - fopen, popen, and - fsockopen - - - + + + + + See also readfile, + fopen, popen, and + fsockopen + + + - - - fputcsv - - Format line as CSV and write to file pointer - - - - Description - - intfputcsv - resourcehandle - arrayfields - stringdelimiter - stringenclosure - - - fputcsv formats a line (passed as a - fields array) as CSV and write it to the - specified file handle. Returns the length of the - written string, or &false; on failure. - - - The optional delimiter parameter sets the field - delimiter (one character only). Defaults as a comma: ,. - - - The optional enclosure parameter sets the field - enclosure (one character only) and defaults to a double quotation mark: - ". - - - - <function>fputcsv</function> example - + + + + fputcsv + Format line as CSV and write to file pointer + + + Description + + intfputcsv + resourcehandle + arrayfields + stringdelimiter + stringenclosure + + + fputcsv formats a line (passed as a + fields array) as CSV and write it to the + specified file handle. Returns the length of the + written string, or &false; on failure. + + + The optional delimiter parameter sets the field + delimiter (one character only). Defaults as a comma: ,. + + + The optional enclosure parameter sets the field + enclosure (one character only) and defaults to a double quotation mark: + ". + + + + <function>fputcsv</function> example + ]]> - - - - ¬e.line-endings; - - See also fgetcsv. - - - + + + + ¬e.line-endings; + + See also fgetcsv. + + + + - - - fread - Binary-safe file read - - - Description - - stringfread - resourcehandle - intlength - - - fread reads up to - length bytes from the file pointer - referenced by handle. Reading stops when up to - length bytes have been read, EOF - (end of file) is reached, (for network streams) when a packet becomes - available, or (after opening userspace stream) when 8192 bytes have been read - whichever comes first. - - - Returns the read string or &false; in case of error. - - - - + + + fread + Binary-safe file read + + + Description + + stringfread + resourcehandle + intlength + + + fread reads up to + length bytes from the file pointer + referenced by handle. Reading stops when up to + length bytes have been read, EOF + (end of file) is reached, (for network streams) when a packet becomes + available, or (after opening userspace stream) when 8192 bytes have been read + whichever comes first. + + + Returns the read string or &false; in case of error. + + + + ]]> - - - - - - On systems which differentiate between binary and text files - (i.e. Windows) the file must be opened with 'b' included in - fopen mode parameter. - - - - - + + + + + + On systems which differentiate between binary and text files + (i.e. Windows) the file must be opened with 'b' included in + fopen mode parameter. + + + + + ]]> - - - + + + - - - When reading from anything that is not a regular local file, such as - streams returned when - reading remote files or from - popen and fsockopen, reading - will stop after a packet is available. This means that you should - collect the data together in chunks as shown in the examples below. - - - - - + + + When reading from anything that is not a regular local file, such as + streams returned when + reading remote files or from + popen and fsockopen, reading + will stop after a packet is available. This means that you should + collect the data together in chunks as shown in the examples below. + + + + + ]]> - - - - - - + + + + + + ]]> - - - - - - If you just want to get the contents of a file into a string, use - file_get_contents as it has much better performance - than the code above. - - - - See also fwrite, fopen, - fsockopen, popen, - fgets, fgetss, - fscanf, file, and - fpassthru. - - - + + + + + + If you just want to get the contents of a file into a string, use + file_get_contents as it has much better performance + than the code above. + + + + See also fwrite, fopen, + fsockopen, popen, + fgets, fgetss, + fscanf, file, and + fpassthru. + + + + - - - fscanf - Parses input from a file according to a format - - - Description - - mixedfscanf - resourcehandle - stringformat - mixed... - - - The function fscanf is similar to - sscanf, but it takes its input from a file - associated with handle and interprets the - input according to the specified format, which is - described in the documentation for sprintf. If only - two parameters were passed to this function, the values parsed will be - returned as an array. Otherwise, if optional parameters are passed, the - function will return the number of assigned values. The optional - parameters must be passed by reference. - - - Any whitespace in the format string matches any whitespace in the input - stream. This means that even a tab \t in the format - string can match a single space character in the input stream. - - - - <function>fscanf</function> Example - + + + fscanf + Parses input from a file according to a format + + + Description + + mixedfscanf + resourcehandle + stringformat + mixed... + + + The function fscanf is similar to + sscanf, but it takes its input from a file + associated with handle and interprets the + input according to the specified format, which is + described in the documentation for sprintf. If only + two parameters were passed to this function, the values parsed will be + returned as an array. Otherwise, if optional parameters are passed, the + function will return the number of assigned values. The optional + parameters must be passed by reference. + + + Any whitespace in the format string matches any whitespace in the input + stream. This means that even a tab \t in the format + string can match a single space character in the input stream. + + + + <function>fscanf</function> Example + ]]> - - - - Contents of users.txt - + + + + Contents of users.txt + - - - - - - Prior to PHP 4.3.0, the maximum number of characters read from - the file was 512 (or up to the first \n, whichever came first). - As of PHP 4.3.0 arbitrarily long lines will be read and scanned. - - - - See also fread, fgets, - fgetss, sscanf, - printf, and sprintf. - - - + + + + + + Prior to PHP 4.3.0, the maximum number of characters read from + the file was 512 (or up to the first \n, whichever came first). + As of PHP 4.3.0 arbitrarily long lines will be read and scanned. + + + + See also fread, fgets, + fgetss, sscanf, + printf, and sprintf. + + + + - - - fseek - Seeks on a file pointer - - - Description - - intfseek - resourcehandle - intoffset - intwhence - - - Sets the file position indicator for the file referenced by - handle. The new position, measured in bytes - from the beginning of the file, is obtained by adding - offset to the position specified by - whence, whose values are defined as - follows: - - SEEK_SET - Set position equal to offset bytes. - SEEK_CUR - Set position to current location plus offset. - SEEK_END - Set position to end-of-file plus offset. - (To move to a position before the end-of-file, you need to pass a negative - value in offset.) - - - - If whence is not specified, it is assumed to be - SEEK_SET. - - - Upon success, returns 0; otherwise, returns -1. Note that seeking - past EOF is not considered an error. - - - - <function>fseek</function> example - + + + fseek + Seeks on a file pointer + + + Description + + intfseek + resourcehandle + intoffset + intwhence + + + Sets the file position indicator for the file referenced by + handle. The new position, measured in bytes + from the beginning of the file, is obtained by adding + offset to the position specified by + whence, whose values are defined as + follows: + + SEEK_SET - Set position equal to offset bytes. + SEEK_CUR - Set position to current location plus offset. + SEEK_END - Set position to end-of-file plus offset. + (To move to a position before the end-of-file, you need to pass a negative + value in offset.) + + + + If whence is not specified, it is assumed to be + SEEK_SET. + + + Upon success, returns 0; otherwise, returns -1. Note that seeking + past EOF is not considered an error. + + + + <function>fseek</function> example + ]]> - - - - - May not be used on file pointers returned by - fopen if they use the "http://" or "ftp://" - formats. fseek gives also undefined results for - append-only streams (opened with "a" flag). - - - - The whence argument was added after PHP 4.0.0. - - - - - If you have opened the file in append ("a" or "a+") mode, any data you write - to the file will always be appended, regardless of the file position. - - - - See also ftell and - rewind. - - - + + + + + May not be used on file pointers returned by + fopen if they use the "http://" or "ftp://" + formats. fseek gives also undefined results for + append-only streams (opened with "a" flag). + + + + The whence argument was added after PHP 4.0.0. + + + + + If you have opened the file in append ("a" or "a+") mode, any data you write + to the file will always be appended, regardless of the file position. + + + + See also ftell and + rewind. + + + + - - - fstat - Gets information about a file using an open file pointer - - - Description - - arrayfstat - resourcehandle - - - Gathers the statistics of the file opened by the file - pointer handle. This function is similar to the - stat function except that it operates - on an open file pointer instead of a filename. - - - Returns an array with the statistics of the file; the format of the array - is described in detail on the stat manual page. - - - - <function>fstat</function> example - + + + fstat + Gets information about a file using an open file pointer + + + Description + + arrayfstat + resourcehandle + + + Gathers the statistics of the file opened by the file + pointer handle. This function is similar to the + stat function except that it operates + on an open file pointer instead of a filename. + + + Returns an array with the statistics of the file; the format of the array + is described in detail on the stat manual page. + + + + <function>fstat</function> example + ]]> - - &example.outputs.similar; - + + &example.outputs.similar; + 8 ) ]]> - - - - - ¬e.no-remote; + + + - - + ¬e.no-remote; + + + + - - - ftell - Tells file pointer read/write position - - - Description - - intftell - resourcehandle - - - Returns the position of the file pointer referenced by - handle; i.e., its offset into the - file stream. - - - If an error occurs, returns &false;. - - - The file pointer must be valid, and must point to a file - successfully opened by fopen or - popen. - ftell gives undefined results for append-only streams - (opened with "a" flag). - - - - <function>ftell</function> example - + + + ftell + Tells file pointer read/write position + + + Description + + intftell + resourcehandle + + + Returns the position of the file pointer referenced by + handle; i.e., its offset into the + file stream. + + + If an error occurs, returns &false;. + + + The file pointer must be valid, and must point to a file + successfully opened by fopen or + popen. + ftell gives undefined results for append-only streams + (opened with "a" flag). + + + + <function>ftell</function> example + ]]> - - - - - See also fopen, popen, - fseek, and rewind. - - - + + + + + See also fopen, popen, + fseek, and rewind. + + + + - - - ftruncate - Truncates a file to a given length - - - Description - - boolftruncate - resourcehandle - intsize - - - Takes the filepointer, handle, and truncates the file to - length, size. &return.success; - - - - The file pointer is changed only in append mode. In - write mode, additional fseek - call is needed. - - - - - Prior to PHP 4.3.3, ftruncate returns an - integer value of 1 on success, instead of - boolean &true;. - - - - See also fopen and - fseek. - - - + + + ftruncate + Truncates a file to a given length + + + Description + + boolftruncate + resourcehandle + intsize + + + Takes the filepointer, handle, and truncates the file to + length, size. &return.success; + + + + The file pointer is changed only in append mode. In + write mode, additional fseek + call is needed. + + + + + Prior to PHP 4.3.3, ftruncate returns an + integer value of 1 on success, instead of + boolean &true;. + + + + See also fopen and + fseek. + + + + - - - fwrite - Binary-safe file write - - - Description - - intfwrite - resourcehandle - stringstring - intlength - - - fwrite writes the contents of - string to the file stream pointed to by - handle. If the length - argument is given, writing will stop after - length bytes have been written or the end - of string is reached, whichever comes - first. - - - fwrite returns the number of bytes - written, or &false; on error. - - - Note that if the length argument is given, - then the magic_quotes_runtime - configuration option will be ignored and no slashes will be - stripped from string. - - - - On systems which differentiate between binary and text files - (i.e. Windows) the file must be opened with 'b' included in - fopen mode parameter. - - - - - A simple <function>fwrite</function> example - - + + fwrite + Binary-safe file write + + + Description + + intfwrite + resourcehandle + stringstring + intlength + + + fwrite writes the contents of + string to the file stream pointed to by + handle. If the length + argument is given, writing will stop after + length bytes have been written or the end + of string is reached, whichever comes + first. + + + fwrite returns the number of bytes + written, or &false; on error. + + + Note that if the length argument is given, + then the magic_quotes_runtime + configuration option will be ignored and no slashes will be + stripped from string. + + + + On systems which differentiate between binary and text files + (i.e. Windows) the file must be opened with 'b' included in + fopen mode parameter. + + + + + A simple <function>fwrite</function> example + + ]]> - - - - - See also fread, - fopen, - fsockopen, - popen, and - file_put_contents. - - - + + + + + See also fread, + fopen, + fsockopen, + popen, and + file_put_contents. + + + - - - glob - Find pathnames matching a pattern - - - Description - - arrayglob - stringpattern - intflags - - - The glob function searches for all the pathnames - matching pattern according to the rules used by - the libc glob() function, which is similar to the rules used by common - shells. No tilde expansion or parameter substitution is done. - - - Returns an array containing the matched files/directories, an empty array - if no file matched or &false; on error. - - - Valid flags: - - - - GLOB_MARK - Adds a slash to each item returned - - - - - GLOB_NOSORT - Return files as they appear in the - directory (no sorting) - - - - - GLOB_NOCHECK - Return the search pattern if no - files matching it were found - - - - - GLOB_NOESCAPE - Backslashes do not quote - metacharacters - - - - - GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', - or 'c' - - - - This flag is not available on some non GNU systems, like Solaris. - - - - - - GLOB_ONLYDIR - Return only directory entries - which match the pattern - - - - Before PHP 4.3.3 GLOB_ONLYDIR was - not - available on Windows and other systems not using the GNU - C library. - - - - - - GLOB_ERR - Stop on read errors (like unreadable - directories), by default errors are ignored. Added in PHP 5.1.0. - - - - - - - - Convenient way how <function>glob</function> can replace - <function>opendir</function> and friends. - - + + + + glob + Find pathnames matching a pattern + + + Description + + arrayglob + stringpattern + intflags + + + The glob function searches for all the pathnames + matching pattern according to the rules used by + the libc glob() function, which is similar to the rules used by common + shells. No tilde expansion or parameter substitution is done. + + + Returns an array containing the matched files/directories, an empty array + if no file matched or &false; on error. + + + Valid flags: + + + + GLOB_MARK - Adds a slash to each item returned + + + + + GLOB_NOSORT - Return files as they appear in the + directory (no sorting) + + + + + GLOB_NOCHECK - Return the search pattern if no + files matching it were found + + + + + GLOB_NOESCAPE - Backslashes do not quote + metacharacters + + + + + GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', + or 'c' + + + + This flag is not available on some non GNU systems, like Solaris. + + + + + + GLOB_ONLYDIR - Return only directory entries + which match the pattern + + + + Before PHP 4.3.3 GLOB_ONLYDIR was + not + available on Windows and other systems not using the GNU + C library. + + + + + + GLOB_ERR - Stop on read errors (like unreadable + directories), by default errors are ignored. Added in PHP 5.1.0. + + + + + + + + Convenient way how <function>glob</function> can replace + <function>opendir</function> and friends. + + ]]> - - &example.outputs.similar; - + + &example.outputs.similar; + - - - - - ¬e.no-remote; - - - This function isn't available on some systems (e.g. old Sun OS). - - - - - See also opendir, - readdir, - closedir, and fnmatch. - - - + + + + + ¬e.no-remote; + + + This function isn't available on some systems (e.g. old Sun OS). + + + + + See also opendir, + readdir, + closedir, and fnmatch. + + + + - - - is_dir - Tells whether the filename is a directory - - - Description - - boolis_dir - stringfilename - - - Returns &true; if the filename exists and is a directory. If - filename is a relative filename, it will be - checked relative to the current working directory. - - ¬e.clearstatcache; - - - <function>is_dir</function> example - + + + is_dir + Tells whether the filename is a directory + + + Description + + boolis_dir + stringfilename + + + Returns &true; if the filename exists and is a directory. If + filename is a relative filename, it will be + checked relative to the current working directory. + + ¬e.clearstatcache; + + + <function>is_dir</function> example + ]]> - - &example.outputs; - + + &example.outputs; + - - - - &tip.fopen-wrapper.stat; + + + + &tip.fopen-wrapper.stat; - - See also chdir, dir, - opendir, is_file and - is_link. - - - + + See also chdir, dir, + opendir, is_file and + is_link. + + + + - - - is_executable - Tells whether the filename is executable - - - Description - - boolis_executable - stringfilename - - - Returns &true; if the filename exists and is executable. - - - is_executable became available with - Windows in PHP version 5.0.0. - - - - <function>is_executable</function> example - + + + is_executable + Tells whether the filename is executable + + + Description + + boolis_executable + stringfilename + + + Returns &true; if the filename exists and is executable. + + + is_executable became available with + Windows in PHP version 5.0.0. + + + + <function>is_executable</function> example + ]]> - - - - - ¬e.clearstatcache; + + + - &tip.fopen-wrapper.stat; + ¬e.clearstatcache; - - See also is_file and - is_link. - - - + &tip.fopen-wrapper.stat; + + + See also is_file and + is_link. + + + + - - - is_file - Tells whether the filename is a regular file - - - Description - - boolis_file - stringfilename - - - Returns &true; if the filename exists and is a regular file. - - - - <function>is_file</function> example - + + + is_file + Tells whether the filename is a regular file + + + Description + + boolis_file + stringfilename + + + Returns &true; if the filename exists and is a regular file. + + + + <function>is_file</function> example + ]]> - - &example.outputs; - + + &example.outputs; + - - - + + + - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; + ¬e.clearstatcache; - - See also is_dir and - is_link. - - - + &tip.fopen-wrapper.stat; + + + See also is_dir and + is_link. + + + + - - - is_link - Tells whether the filename is a symbolic link - - - Description - - boolis_link - stringfilename - - - Returns &true; if the filename exists and is a symbolic link. - - - ¬e.clearstatcache; + + + is_link + Tells whether the filename is a symbolic link + + + Description + + boolis_link + stringfilename + + + Returns &true; if the filename exists and is a symbolic link. + - &tip.fopen-wrapper.stat; - - - See also is_dir, - is_file, and readlink. - - - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + See also is_dir, + is_file, and readlink. + + + + - - - is_readable - Tells whether the filename is readable - - - Description - - boolis_readable - stringfilename - - - Returns &true; if the file or directory specified by - filename exists and is readable. - - - Keep in mind that PHP may be accessing the file as the user - id that the web server runs as (often 'nobody'). Safe mode - limitations are not taken into account. - - - - <function>is_readable</function> example - - + + is_readable + Tells whether the filename is readable + + + Description + + boolis_readable + stringfilename + + + Returns &true; if the file or directory specified by + filename exists and is readable. + + + Keep in mind that PHP may be accessing the file as the user + id that the web server runs as (often 'nobody'). Safe mode + limitations are not taken into account. + + + + <function>is_readable</function> example + + ]]> - - - + + + - ¬e.clearstatcache; + ¬e.clearstatcache; - &tip.fopen-wrapper.stat; + &tip.fopen-wrapper.stat; - - See also is_writable, - file_exists, and - fgets. - - - + + See also is_writable, + file_exists, and + fgets. + + + + - - - is_uploaded_file - Tells whether the file was uploaded via HTTP POST - - - Description - - boolis_uploaded_file - stringfilename - - - Returns &true; if the file named by filename was - uploaded via HTTP POST. This is useful to help ensure that a - malicious user hasn't tried to trick the script into working on - files upon which it should not be working--for instance, - /etc/passwd. - - - This sort of check is especially important if there is any chance - that anything done with uploaded files could reveal their - contents to the user, or even to other users on the same - system. - - - For proper working, the function is_uploaded_file needs - an argument like $_FILES['userfile']['tmp_name'], - the name of the uploaded - file on the clients machine $_FILES['userfile']['name'] does not work. - - - <function>is_uploaded_file</function> example - + + + is_uploaded_file + Tells whether the file was uploaded via HTTP POST + + + Description + + boolis_uploaded_file + stringfilename + + + Returns &true; if the file named by filename was + uploaded via HTTP POST. This is useful to help ensure that a + malicious user hasn't tried to trick the script into working on + files upon which it should not be working--for instance, + /etc/passwd. + + + This sort of check is especially important if there is any chance + that anything done with uploaded files could reveal their + contents to the user, or even to other users on the same + system. + + + For proper working, the function is_uploaded_file needs + an argument like $_FILES['userfile']['tmp_name'], - the name of the uploaded + file on the clients machine $_FILES['userfile']['name'] does not work. + + + <function>is_uploaded_file</function> example + ]]> - - + + + + is_uploaded_file is available only in + versions of PHP 3 after PHP 3.0.16, and in versions of PHP 4 + after 4.0.2. If you are stuck using an earlier version, you can + use the following function to help protect yourself: + - is_uploaded_file is available only in - versions of PHP 3 after PHP 3.0.16, and in versions of PHP 4 - after 4.0.2. If you are stuck using an earlier version, you can - use the following function to help protect yourself: - - - The following example will not work in - versions of PHP 4 after 4.0.2. It depends on internal - functionality of PHP which changed after that version. - - + The following example will not work in + versions of PHP 4 after 4.0.2. It depends on internal + functionality of PHP which changed after that version. - - <function>is_uploaded_file</function> example for PHP 4 < 4.0.3 - + + + + <function>is_uploaded_file</function> example for PHP 4 < 4.0.3 + ]]> - - - - See also move_uploaded_file, and the section - Handling file uploads - for a simple usage example. - - - + + + + See also move_uploaded_file, and the section + Handling file uploads + for a simple usage example. + + + + - - - is_writable - Tells whether the filename is writable - - - Description - - boolis_writable - stringfilename - - - Returns &true; if the filename exists and is - writable. The filename argument may be a directory name allowing you - to check if a directory is writeable. - - - Keep in mind that PHP may be accessing the file as the user id - that the web server runs as (often 'nobody'). Safe mode - limitations are not taken into account. - - - - <function>is_writable</function> example - - + + is_writable + Tells whether the filename is writable + + + Description + + boolis_writable + stringfilename + + + Returns &true; if the filename exists and is + writable. The filename argument may be a directory name allowing you + to check if a directory is writeable. + + + Keep in mind that PHP may be accessing the file as the user id + that the web server runs as (often 'nobody'). Safe mode + limitations are not taken into account. + + + + <function>is_writable</function> example + + ]]> - - - + + + - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; - - - See also is_readable, - file_exists, and - fwrite. - - - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + See also is_readable, + file_exists, and + fwrite. + + + - - - lchgrp - Changes group ownership of symlink - - - Description - - boollchgrp - stringfilename - mixedgroup - - - Attempts to change the group of the symlink filename - to group (specified by name or number). Only the - superuser may change the group of a symlink arbitrarily; other users may - change the group of a symlink to any group of which that user is a member. - - - &return.success; - - ¬e.no-remote; - ¬e.sm.uidcheck; - - See also chgrp, - lchown - chown&listendand; - chmod. - - - + + + + lchgrp + Changes group ownership of symlink + + + Description + + boollchgrp + stringfilename + mixedgroup + + + Attempts to change the group of the symlink filename + to group (specified by name or number). Only the + superuser may change the group of a symlink arbitrarily; other users may + change the group of a symlink to any group of which that user is a member. + + + &return.success; + + ¬e.no-remote; + ¬e.sm.uidcheck; + + See also chgrp, + lchown + chown&listendand; + chmod. + + + - - - lchown - Changes user ownership of symlink - - - Description - - boollchown - stringfilename - mixeduser - - - Attempts to change the owner of the symlink filename - to user user (specified by name or number). Only - the superuser may change the owner of a symlink. - - - &return.success; - - ¬e.no-remote; - ¬e.sm.uidcheck; - - See also chown, - lchgrp, - chgrp&listendand; - chmod. - - - + + + + lchown + Changes user ownership of symlink + + + Description + + boollchown + stringfilename + mixeduser + + + Attempts to change the owner of the symlink filename + to user user (specified by name or number). Only + the superuser may change the owner of a symlink. + + + &return.success; + + ¬e.no-remote; + ¬e.sm.uidcheck; + + See also chown, + lchgrp, + chgrp&listendand; + chmod. + + + + - - - link - Create a hard link - - - Description - - boollink - stringtarget - stringlink - - - link creates a hard link. &return.success; - - - ¬e.no-remote; - ¬e.no-windows; + + + link + Create a hard link + + + Description + + boollink + stringtarget + stringlink + + + link creates a hard link. &return.success; + - - See also the symlink to create soft links, - and readlink along with - linkinfo. - - - + ¬e.no-remote; + ¬e.no-windows; + + + See also the symlink to create soft links, + and readlink along with + linkinfo. + + + + - - - linkinfo - Gets information about a link - - - Description - - intlinkinfo - stringpath - - - linkinfo returns the st_dev - field of the Unix C stat structure returned by the lstat - system call. This function is used to verify if a link (pointed to by - path) really exists (using the same method - as the S_ISLNK macro defined in stat.h). - Returns 0 or &false; in - case of error. - - - - <function>linkinfo</function> example - + + + linkinfo + Gets information about a link + + + Description + + intlinkinfo + stringpath + + + linkinfo returns the st_dev + field of the Unix C stat structure returned by the lstat + system call. This function is used to verify if a link (pointed to by + path) really exists (using the same method + as the S_ISLNK macro defined in stat.h). + Returns 0 or &false; in + case of error. + + + + <function>linkinfo</function> example + ]]> - - - - ¬e.no-windows; - - See also symlink, link, - and readlink. - - - + + + + ¬e.no-windows; + + See also symlink, link, + and readlink. + + + + - - - lstat - Gives information about a file or symbolic link - - - Description - - arraylstat - stringfilename - - - Gathers the statistics of the file or symbolic link named by - filename. This function is identical to the - stat function except that if the - filename parameter is a symbolic link, the - status of the symbolic link is returned, not the status of the - file pointed to by the symbolic link. - - - See the manual page for stat for information on - the structure of the array that lstat returns. - + + + lstat + Gives information about a file or symbolic link + + + Description + + arraylstat + stringfilename + + + Gathers the statistics of the file or symbolic link named by + filename. This function is identical to the + stat function except that if the + filename parameter is a symbolic link, the + status of the symbolic link is returned, not the status of the + file pointed to by the symbolic link. + + + See the manual page for stat for information on + the structure of the array that lstat returns. + - ¬e.clearstatcache; - - &tip.fopen-wrapper.stat; - - - See also stat. - - - + ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + See also stat. + + + + - - - mkdir - Makes directory - - - Description - - boolmkdir - stringpathname - intmode - boolrecursive - resourcecontext - + + + mkdir + Makes directory + + + Description + + boolmkdir + stringpathname + intmode + boolrecursive + resourcecontext + + + Attempts to create the directory specified by pathname. + + + Note that you probably want to specify the mode as an + octal number, which means it should have a leading zero. + The mode is also modified by the current umask, which you + can change using umask. + + + - Attempts to create the directory specified by pathname. + Mode is ignored on Windows, and became optional in PHP 4.2.0. - - Note that you probably want to specify the mode as an - octal number, which means it should have a leading zero. - The mode is also modified by the current umask, which you - can change using umask. - - - - - Mode is ignored on Windows, and became optional in PHP 4.2.0. - - - - - The mode is 0777 by default, which means the widest possible - access. For more information on modes, read the details - on the chmod page. - - <function>mkdir</function> example - + + + + The mode is 0777 by default, which means the widest possible + access. For more information on modes, read the details + on the chmod page. + + <function>mkdir</function> example + ]]> - - - - - &return.success; - - - - As of PHP 5.0.0 mkdir can also be - used with some URL wrappers. Refer to - for a listing of which wrappers support mkdir. - - - ¬e.context-support; - - - The recursive parameter was added as of PHP 5.0.0. - - - ¬e.sm.uidcheck.dir; - - See also rmdir. - - - + + + + + &return.success; + + + + As of PHP 5.0.0 mkdir can also be + used with some URL wrappers. Refer to + for a listing of which wrappers support mkdir. + + + ¬e.context-support; + + + The recursive parameter was added as of PHP 5.0.0. + + + ¬e.sm.uidcheck.dir; + + See also rmdir. + + + + - - - move_uploaded_file - Moves an uploaded file to a new location - - - Description - - boolmove_uploaded_file - stringfilename - stringdestination - - - This function checks to ensure that the file designated by - filename is a valid upload file (meaning - that it was uploaded via PHP's HTTP POST upload mechanism). If - the file is valid, it will be moved to the filename given by - destination. - - - If filename is not a valid upload file, - then no action will occur, and - move_uploaded_file will return - &false;. - - - If filename is a valid upload file, but - cannot be moved for some reason, no action will occur, and - move_uploaded_file will return - &false;. Additionally, a warning will be issued. - - - This sort of check is especially important if there is any chance - that anything done with uploaded files could reveal their - contents to the user, or even to other users on the same - system. - - - - move_uploaded_file is both &safemode; - and open_basedir - aware. However, restrictions are placed only on the - destination path as to allow the moving - of uploaded files in which filename may conflict - with such restrictions. move_uploaded_file ensures - the safety of this operation by allowing only those files uploaded - through PHP to be moved. - - - - - If the destination file already exists, it will be overwritten. - - - - See also is_uploaded_file, and the section - Handling file uploads - for a simple usage example. - - - + + + move_uploaded_file + Moves an uploaded file to a new location + + + Description + + boolmove_uploaded_file + stringfilename + stringdestination + + + This function checks to ensure that the file designated by + filename is a valid upload file (meaning + that it was uploaded via PHP's HTTP POST upload mechanism). If + the file is valid, it will be moved to the filename given by + destination. + + + If filename is not a valid upload file, + then no action will occur, and + move_uploaded_file will return + &false;. + + + If filename is a valid upload file, but + cannot be moved for some reason, no action will occur, and + move_uploaded_file will return + &false;. Additionally, a warning will be issued. + + + This sort of check is especially important if there is any chance + that anything done with uploaded files could reveal their + contents to the user, or even to other users on the same + system. + + + + move_uploaded_file is both &safemode; + and open_basedir + aware. However, restrictions are placed only on the + destination path as to allow the moving + of uploaded files in which filename may conflict + with such restrictions. move_uploaded_file ensures + the safety of this operation by allowing only those files uploaded + through PHP to be moved. + + + + + If the destination file already exists, it will be overwritten. + + + + See also is_uploaded_file, and the section + Handling file uploads + for a simple usage example. + + + + - - - parse_ini_file - Parse a configuration file - - - Description - - arrayparse_ini_file - stringfilename - boolprocess_sections - - - parse_ini_file loads in the - ini file specified in filename, - and returns the settings in it in an associative array. - By setting the last process_sections - parameter to &true;, you get a multidimensional array, with - the section names and settings included. The default - for process_sections is &false; - - - - This function has nothing to do with the - &php.ini; file. It is already processed, - the time you run your script. This function can be used to - read in your own application's configuration files. - - - - - If a value in the ini file contains any non-alphanumeric - characters it needs to be enclosed in double-quotes ("). - - - - - Since PHP 4.2.1 this function is also affected by &safemode; - and open_basedir. - - - - - As of PHP 5.0 this function also handles new lines in values. - - - - - There are reserved words which must not be used as keys for - ini files. These include: null, yes, no, true, and false. - Values null, no and false results in "", yes and true results in "1". - Characters {}|&~![()" must not be used anywhere in - the key and have a special meaning in the value. - - - - The structure of the ini file is similar to that of - the &php.ini;'s. - - - Constants may also be parsed - in the ini file so if you define a constant as an ini value before - running parse_ini_file, it will be integrated into - the results. Only ini values are evaluated. For example: - - - - Contents of <filename>sample.ini</filename> - + + + parse_ini_file + Parse a configuration file + + + Description + + arrayparse_ini_file + stringfilename + boolprocess_sections + + + parse_ini_file loads in the + ini file specified in filename, + and returns the settings in it in an associative array. + By setting the last process_sections + parameter to &true;, you get a multidimensional array, with + the section names and settings included. The default + for process_sections is &false; + + + + This function has nothing to do with the + &php.ini; file. It is already processed, + the time you run your script. This function can be used to + read in your own application's configuration files. + + + + + If a value in the ini file contains any non-alphanumeric + characters it needs to be enclosed in double-quotes ("). + + + + + Since PHP 4.2.1 this function is also affected by &safemode; + and open_basedir. + + + + + As of PHP 5.0 this function also handles new lines in values. + + + + + There are reserved words which must not be used as keys for + ini files. These include: null, yes, no, true, and false. + Values null, no and false results in "", yes and true results in "1". + Characters {}|&~![()" must not be used anywhere in + the key and have a special meaning in the value. + + + + The structure of the ini file is similar to that of + the &php.ini;'s. + + + Constants may also be parsed + in the ini file so if you define a constant as an ini value before + running parse_ini_file, it will be integrated into + the results. Only ini values are evaluated. For example: + + + + Contents of <filename>sample.ini</filename> + - - - - - - <function>parse_ini_file</function> example - + + + + + + <function>parse_ini_file</function> example + ]]> - - - Would produce: - - + + + Would produce: + + - - - - - Keys and section names consisting from numbers are evaluated as PHP - integers thus numbers - starting by 0 are evaluated as octals and numbers starting by 0x are - evaluated as hexadecimals. - - - + + + + + Keys and section names consisting from numbers are evaluated as PHP + integers thus numbers + starting by 0 are evaluated as octals and numbers starting by 0x are + evaluated as hexadecimals. + + + + - - - pathinfo - Returns information about a file path - - - Description - - mixedpathinfo - stringpath - intoptions - - - pathinfo returns an associative array - containing information about path. The - following array elements are returned: - dirname, basename - and extension if any. - - - You can specify which elements are returned with optional parameter - options. It composes from - PATHINFO_DIRNAME, - PATHINFO_BASENAME, - PATHINFO_EXTENSION and - PATHINFO_FILENAME (available since PHP 5.2.0). It - defaults to return all elements. This function returns string if not all - elements are requested. - - - - <function>pathinfo</function> Example - + + + pathinfo + Returns information about a file path + + + Description + + mixedpathinfo + stringpath + intoptions + + + pathinfo returns an associative array + containing information about path. The + following array elements are returned: + dirname, basename + and extension if any. + + + You can specify which elements are returned with optional parameter + options. It composes from + PATHINFO_DIRNAME, + PATHINFO_BASENAME, + PATHINFO_EXTENSION and + PATHINFO_FILENAME (available since PHP 5.2.0). It + defaults to return all elements. This function returns string if not all + elements are requested. + + + + <function>pathinfo</function> Example + ]]> - - - Would produce: - - + + + Would produce: + + - - - - - - For information on retrieving the current path info, read - the section on - predefined reserved variables. - - - - See also dirname, - basename, - parse_url - and realpath. - - - + + + + + + For information on retrieving the current path info, read + the section on + predefined reserved variables. + + + + See also dirname, + basename, + parse_url + and realpath. + + + + - - - pclose - Closes process file pointer - - - Description - - intpclose - resourcehandle - - - Closes a file pointer to a pipe opened by - popen. - - - The file pointer must be valid, and must have been returned by a - successful call to popen. - - - Returns the termination status of the process that was - run. - - - See also popen. - - - + + + pclose + Closes process file pointer + + + Description + + intpclose + resourcehandle + + + Closes a file pointer to a pipe opened by + popen. + + + The file pointer must be valid, and must have been returned by a + successful call to popen. + + + Returns the termination status of the process that was + run. + + + See also popen. + + + + - - - popen - Opens process file pointer - - - Description - - resourcepopen - stringcommand - stringmode - - - Opens a pipe to a process executed by forking the command given - by command. - - - Returns a file pointer identical to that returned by - fopen, except that it is unidirectional (may - only be used for reading or writing) and must be closed with - pclose. This pointer may be used with - fgets, fgetss, and - fwrite. - - - If an error occurs, returns &false;. - - - - If you're looking for bi-directional support (two-way), use - proc_open. - - - - - <function>popen</function> example - + + + popen + Opens process file pointer + + + Description + + resourcepopen + stringcommand + stringmode + + + Opens a pipe to a process executed by forking the command given + by command. + + + Returns a file pointer identical to that returned by + fopen, except that it is unidirectional (may + only be used for reading or writing) and must be closed with + pclose. This pointer may be used with + fgets, fgetss, and + fwrite. + + + If an error occurs, returns &false;. + + + + If you're looking for bi-directional support (two-way), use + proc_open. + + + + + <function>popen</function> example + ]]> - - - - - If the command to be executed could not be found, a valid - resource is returned. This may seem odd, but makes sense; it - allows you to access any error message returned by the shell: - - + + + + + If the command to be executed could not be found, a valid + resource is returned. This may seem odd, but makes sense; it + allows you to access any error message returned by the shell: + + ]]> - - - - ¬e.exec-path; - &warn.sm.exec; - - See also pclose, fopen, - and proc_open. - - - + + + + ¬e.exec-path; + &warn.sm.exec; + + See also pclose, fopen, + and proc_open. + + + + - - - readfile - Outputs a file - - - Description - - intreadfile - stringfilename - booluse_include_path - resourcecontext - - - Reads a file and writes it to the output buffer. - - - Returns the number of bytes read from the file. If an error - occurs, &false; is returned and unless the function was called as - @readfile, an error message is printed. - - &tip.fopen-wrapper; - - You can use the optional second parameter and set it to &true;, if - you want to search for the file in the include_path, too. - - ¬e.context-support; - - See also fpassthru, - file, fopen, - include, require, - virtual, file_get_contents, - and . - - - + + + readfile + Outputs a file + + + Description + + intreadfile + stringfilename + booluse_include_path + resourcecontext + + + Reads a file and writes it to the output buffer. + + + Returns the number of bytes read from the file. If an error + occurs, &false; is returned and unless the function was called as + @readfile, an error message is printed. + + &tip.fopen-wrapper; + + You can use the optional second parameter and set it to &true;, if + you want to search for the file in the include_path, too. + + ¬e.context-support; + + See also fpassthru, + file, fopen, + include, require, + virtual, file_get_contents, + and . + + + + - - - readlink - Returns the target of a symbolic link - - - Description - - stringreadlink - stringpath - - - readlink does the same as the readlink C - function and returns the contents of the symbolic link path or &false; - in case of error. - - - - <function>readlink</function> example - + + + readlink + Returns the target of a symbolic link + + + Description + + stringreadlink + stringpath + + + readlink does the same as the readlink C + function and returns the contents of the symbolic link path or &false; + in case of error. + + + + <function>readlink</function> example + ]]> - - - - ¬e.no-windows; - - See also is_link, - symlink, and - linkinfo. - - - + + + + ¬e.no-windows; + + See also is_link, + symlink, and + linkinfo. + + + + - - - realpath - Returns canonicalized absolute pathname - - - Description - - stringrealpath - stringpath - - - realpath expands all symbolic links and - resolves references to '/./', '/../' and extra '/' characters in - the input path and return the canonicalized - absolute pathname. The resulting path will have no symbolic link, - '/./' or '/../' components. - - - realpath returns &false; on failure, e.g. if - the file does not exist. On BSD systems realpath - doesn't fail if only the last path component - doesn't exist, while other systems will return &false;. - - - - <function>realpath</function> example - + + + realpath + Returns canonicalized absolute pathname + + + Description + + stringrealpath + stringpath + + + realpath expands all symbolic links and + resolves references to '/./', '/../' and extra '/' characters in + the input path and return the canonicalized + absolute pathname. The resulting path will have no symbolic link, + '/./' or '/../' components. + + + realpath returns &false; on failure, e.g. if + the file does not exist. On BSD systems realpath + doesn't fail if only the last path component + doesn't exist, while other systems will return &false;. + + + + <function>realpath</function> example + ]]> - - &example.outputs; - + + &example.outputs; + - - - - - See also basename, - dirname, and - pathinfo. - - - + + + + + See also basename, + dirname, and + pathinfo. + + + + - - - rename - Renames a file or directory - - - Description - - boolrename - stringoldname - stringnewname - resourcecontext - - - Attempts to rename oldname to - newname. - - - &return.success; - - - - Example with <function>rename</function> - + + + rename + Renames a file or directory + + + Description + + boolrename + stringoldname + stringnewname + resourcecontext + + + Attempts to rename oldname to + newname. + + + &return.success; + + + + Example with <function>rename</function> + ]]> - - - - - - Prior to PHP 4.3.3, rename could not rename files - across partitions on *nix based systems. - - - - - As of PHP 5.0.0 rename can also be - used with some URL wrappers. Refer to - for a listing of which wrappers support rename. - - - - - The wrapper used in oldname MUST - match the wrapper used in newname. - - - ¬e.context-support; - - See also copy, - unlink, and - move_uploaded_file. - - - + + + + + + Prior to PHP 4.3.3, rename could not rename files + across partitions on *nix based systems. + + + + + As of PHP 5.0.0 rename can also be + used with some URL wrappers. Refer to + for a listing of which wrappers support rename. + + + + + The wrapper used in oldname MUST + match the wrapper used in newname. + + + ¬e.context-support; + + See also copy, + unlink, and + move_uploaded_file. + + + + - - - rewind - Rewind the position of a file pointer - - - Description - - boolrewind - resourcehandle - - - Sets the file position indicator for handle - to the beginning of the file stream. - - - &return.success; - - - The file pointer must be valid, and must point to a file - successfully opened by fopen. - - - - If you have opened the file in append ("a" or "a+") mode, any data you write - to the file will always be appended, regardless of the file position. - - - - See also fseek and - ftell. - - - + + + rewind + Rewind the position of a file pointer + + + Description + + boolrewind + resourcehandle + + + Sets the file position indicator for handle + to the beginning of the file stream. + + + &return.success; + + + The file pointer must be valid, and must point to a file + successfully opened by fopen. + + + + If you have opened the file in append ("a" or "a+") mode, any data you write + to the file will always be appended, regardless of the file position. + + + + See also fseek and + ftell. + + + + - - - rmdir - Removes directory - - - Description - - boolrmdir - stringdirname - resourcecontext - - - Attempts to remove the directory named by dirname. - The directory must be empty, and the relevant permissions must permit this. - &return.success; - - - - As of PHP 5.0.0 rmdir can also be - used with some URL wrappers. Refer to - for a listing of which wrappers support rmdir. - - - ¬e.context-support; - ¬e.sm.uidcheck.dir; - - See also mkdir and unlink. - - - + + + rmdir + Removes directory + + + Description + + boolrmdir + stringdirname + resourcecontext + + + Attempts to remove the directory named by dirname. + The directory must be empty, and the relevant permissions must permit this. + &return.success; + + + + As of PHP 5.0.0 rmdir can also be + used with some URL wrappers. Refer to + for a listing of which wrappers support rmdir. + + + ¬e.context-support; + ¬e.sm.uidcheck.dir; + + See also mkdir and unlink. + + + + - - - stat - Gives information about a file - - - Description - - arraystat - stringfilename - - - Gathers the statistics of the file named by - filename. If filename - is a symbolic link, statistics are from the file itself, not the - symlink. lstat is identical to - stat except it would instead be based off the symlinks - status. - - - In case of error, stat returns &false;. It also - will throw a warning. - - - Returns an array with the statistics of the file with the - following elements. This array is zero-based. In addition to - returning these attributes in a numeric array, they can be accessed - with associative indices, as noted next to each parameter; this is - available since PHP 4.0.6: - - - - <function>stat</function> and <function>fstat</function> result - format - - - - Numeric - Associative (since PHP 4.0.6) - Description - - - - - 0 - dev - device number - - - 1 - ino - inode number - - - 2 - mode - inode protection mode - - - 3 - nlink - number of links - - - 4 - uid - userid of owner - - - 5 - gid - groupid of owner - - - 6 - rdev - device type, if inode device * - - - 7 - size - size in bytes - - - 8 - atime - time of last access (Unix timestamp) - - - 9 - mtime - time of last modification (Unix timestamp) - - - 10 - ctime - time of last inode change (Unix timestamp) - - - 11 - blksize - blocksize of filesystem IO * - - - 12 - blocks - number of blocks allocated - + + + stat + Gives information about a file + + + Description + + arraystat + stringfilename + + + Gathers the statistics of the file named by + filename. If filename + is a symbolic link, statistics are from the file itself, not the + symlink. lstat is identical to + stat except it would instead be based off the symlinks + status. + + + In case of error, stat returns &false;. It also + will throw a warning. + + + Returns an array with the statistics of the file with the + following elements. This array is zero-based. In addition to + returning these attributes in a numeric array, they can be accessed + with associative indices, as noted next to each parameter; this is + available since PHP 4.0.6: + + +
+ <function>stat</function> and <function>fstat</function> result + format + + + + Numeric + Associative (since PHP 4.0.6) + Description + + + + + 0 + dev + device number + + + 1 + ino + inode number + + + 2 + mode + inode protection mode + + + 3 + nlink + number of links + + + 4 + uid + userid of owner + + + 5 + gid + groupid of owner + + + 6 + rdev + device type, if inode device * + + + 7 + size + size in bytes + + + 8 + atime + time of last access (Unix timestamp) + + + 9 + mtime + time of last modification (Unix timestamp) + + + 10 + ctime + time of last inode change (Unix timestamp) + + + 11 + blksize + blocksize of filesystem IO * + + + 12 + blocks + number of blocks allocated + - - -
+ + + - * Only valid on systems supporting the st_blksize type - other - systems (e.g. Windows) return -1. -
- - ¬e.clearstatcache; + * Only valid on systems supporting the st_blksize type - other + systems (e.g. Windows) return -1. + - &tip.fopen-wrapper.stat; - - - See also lstat, - fstat, - filemtime, and - filegroup. - -
-
+ ¬e.clearstatcache; + + &tip.fopen-wrapper.stat; + + + See also lstat, + fstat, + filemtime, and + filegroup. + + + + - - - symlink - Creates a symbolic link - - - Description - - boolsymlink - stringtarget - stringlink - - - symlink creates a symbolic link - to the existing target with - the specified name link. - - - &return.success; - - ¬e.no-windows; - - See also link to create hard links, - and readlink along with - linkinfo. - - - + + + symlink + Creates a symbolic link + + + Description + + boolsymlink + stringtarget + stringlink + + + symlink creates a symbolic link + to the existing target with + the specified name link. + + + &return.success; + + ¬e.no-windows; + + See also link to create hard links, + and readlink along with + linkinfo. + + + + - - - tempnam - Create file with unique file name - - - Description - - stringtempnam - stringdir - stringprefix - - - Creates a file with a unique filename in the specified directory. - If the directory does not exist, tempnam may - generate a file in the system's temporary directory, and return - the name of that. - - - Prior to PHP 4.0.6, the behaviour of the - tempnam function was system dependent. On - Windows the TMP environment variable will override the - dir parameter, on Linux the TMPDIR - environment variable has precedence, while SVR4 will always use - your dir parameter if the directory it - points to exists. Consult your system documentation on the - tempnam(3) function if in doubt. - - - - If PHP cannot create a file in the specified dir - parameter, it falls back on the system default. - - - - Returns the new temporary filename, or &false; on - failure. - - <function>tempnam</function> example - + + + tempnam + Create file with unique file name + + + Description + + stringtempnam + stringdir + stringprefix + + + Creates a file with a unique filename in the specified directory. + If the directory does not exist, tempnam may + generate a file in the system's temporary directory, and return + the name of that. + + + Prior to PHP 4.0.6, the behaviour of the + tempnam function was system dependent. On + Windows the TMP environment variable will override the + dir parameter, on Linux the TMPDIR + environment variable has precedence, while SVR4 will always use + your dir parameter if the directory it + points to exists. Consult your system documentation on the + tempnam(3) function if in doubt. + + + + If PHP cannot create a file in the specified dir + parameter, it falls back on the system default. + + + + Returns the new temporary filename, or &false; on + failure. + + <function>tempnam</function> example + ]]> - - - - - - This function's behavior changed in 4.0.3. The temporary file is also - created to avoid a race condition where the file might appear in the - filesystem between the time the string was generated and before - the script gets around to creating the file. Note, that you need - to remove the file in case you need it no more, it is not done - automatically. - - - - See also tmpfile, sys_get_temp_dir - and unlink. - - - + + + + + + This function's behavior changed in 4.0.3. The temporary file is also + created to avoid a race condition where the file might appear in the + filesystem between the time the string was generated and before + the script gets around to creating the file. Note, that you need + to remove the file in case you need it no more, it is not done + automatically. + + + + See also tmpfile, sys_get_temp_dir + and unlink. + + + + - - - tmpfile - Creates a temporary file - - - Description - - resourcetmpfile - - - - Creates a temporary file with a unique name in read-write (w+) mode, - returning a file handle similar to the one returned by - fopen. - The file is automatically removed when closed (using - fclose), or when the script ends. - - - For details, consult your system documentation on the - tmpfile(3) function, as well as the - stdio.h header file. - - - - <function>tmpfile</function> example - + + + tmpfile + Creates a temporary file + + + Description + + resourcetmpfile + + + + Creates a temporary file with a unique name in read-write (w+) mode, + returning a file handle similar to the one returned by + fopen. + The file is automatically removed when closed (using + fclose), or when the script ends. + + + For details, consult your system documentation on the + tmpfile(3) function, as well as the + stdio.h header file. + + + + <function>tmpfile</function> example + ]]> - - &example.outputs; - + + &example.outputs; + - - - - - See also tempnam, sys_get_temp_dir. - - - + + + + + See also tempnam, sys_get_temp_dir. + + + + - - - touch - Sets access and modification time of file - - - Description - - booltouch - stringfilename - inttime - intatime - - - Attempts to set the access and modification times of the file named in the - filename parameter to the value given in - time. If time - is not supplied, the current system time is used. If the third parameter, - is present, the access time of the given - filename is set to the value of atime. - Note that the access time is always modified, regardless of the number - of parameters. - - - If the file does not exist, it will be created. &return.success; - - - - It is not currently possible to change the modification time of a - directory with this function under Windows. - - - - - <function>touch</function> example - + + + touch + Sets access and modification time of file + + + Description + + booltouch + stringfilename + inttime + intatime + + + Attempts to set the access and modification times of the file named in the + filename parameter to the value given in + time. If time + is not supplied, the current system time is used. If the third parameter, + is present, the access time of the given + filename is set to the value of atime. + Note that the access time is always modified, regardless of the number + of parameters. + + + If the file does not exist, it will be created. &return.success; + + + + It is not currently possible to change the modification time of a + directory with this function under Windows. + + + + + <function>touch</function> example + ]]> - - - - - + + + + + + - - - umask - Changes the current umask - - - Description - - intumask - intmask - - - umask sets PHP's umask to - mask & 0777 and returns the old - umask. When PHP is being used as a server module, the umask - is restored when each request is finished. - - - umask without arguments simply returns the - current umask. - - - - Avoid using this function in multithreaded webservers. It is better to - change the file permissions with chmod after - creating the file. Using umask can lead to - unexpected behavior of concurrently running scripts and the webserver - itself because they all use the same umask. - - - - - <function>umask</function> example - + + + umask + Changes the current umask + + + Description + + intumask + intmask + + + umask sets PHP's umask to + mask & 0777 and returns the old + umask. When PHP is being used as a server module, the umask + is restored when each request is finished. + + + umask without arguments simply returns the + current umask. + + + + Avoid using this function in multithreaded webservers. It is better to + change the file permissions with chmod after + creating the file. Using umask can lead to + unexpected behavior of concurrently running scripts and the webserver + itself because they all use the same umask. + + + + + <function>umask</function> example + ]]> - - - - - + + + + + + - - - unlink - Deletes a file - - - Description - - boolunlink - stringfilename - resourcecontext - - - Deletes filename. Similar to the Unix C - unlink() function. &return.success; - - - - As of PHP 5.0.0 unlink can also be - used with some URL wrappers. Refer to - for a listing of which wrappers support unlink. - - - ¬e.context-support; - - See also rmdir for removing directories. - - - + + + unlink + Deletes a file + + + Description + + boolunlink + stringfilename + resourcecontext + + + Deletes filename. Similar to the Unix C + unlink() function. &return.success; + + + + As of PHP 5.0.0 unlink can also be + used with some URL wrappers. Refer to + for a listing of which wrappers support unlink. + + + ¬e.context-support; + + See also rmdir for removing directories. + + +