<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Standard PHP Library (SPL) Functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="函数参考" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="socket_write" HREF="function.socket-write.html"><LINK REL="NEXT" TITLE="ArrayIterator::current" HREF="function.arrayiterator-current.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.socket-write.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.arrayiterator-current.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.spl" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >CLV. Standard PHP Library (SPL) Functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN213926" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="spl.intro" >简介</A ></H1 ><P > SPL is a collection of interfaces and classes that are meant to solve standard problems. </P ><DIV CLASS="tip" ><BLOCKQUOTE CLASS="tip" ><P ><B >提示: </B > A more detailed documentation of SPL can be found <A HREF="http://www.php.net/~helly/php/ext/spl/" TARGET="_top" >here</A >. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="spl.installation" >安装</A ></H1 ><P > This extension is available and compiled by default in PHP 5. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="spl.constants" >预定义常量</A ></H1 ><P >以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。</P ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >警告</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P > SPL uses class constants since PHP 5.1. Prior releases use global constants in the form <TT CLASS="constant" ><B >RIT_LEAVES_ONLY</B ></TT >. </P ></TD ></TR ></TABLE ></DIV ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >RecursiveIteratorIterator::LEAVES_ONLY</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >RecursiveIteratorIterator::SELF_FIRST</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >RecursiveIteratorIterator::CHILD_FIRST</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CachingIterator::CALL_TOSTRING</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >CachingIterator::CATCH_GET_CHILD</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ></DL ></DIV ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >目录</B ></DT ><DT ><A HREF="function.arrayiterator-current.html" >ArrayIterator::current</A > -- Return current array entry</DT ><DT ><A HREF="function.arrayiterator-key.html" >ArrayIterator::key</A > -- Return current array key</DT ><DT ><A HREF="function.arrayiterator-next.html" >ArrayIterator::next</A > -- Move to next entry</DT ><DT ><A HREF="function.arrayiterator-rewind.html" >ArrayIterator::rewind</A > -- Rewind array back to the start</DT ><DT ><A HREF="function.arrayiterator-seek.html" >ArrayIterator::seek</A > -- Seek to position</DT ><DT ><A HREF="function.arrayiterator-valid.html" >ArrayIterator::valid</A > -- Check whether array contains more entries</DT ><DT ><A HREF="function.arrayobject-append.html" >ArrayObject::append</A > -- Appends the value</DT ><DT ><A HREF="function.arrayobject-construct.html" >ArrayObject::__construct</A > -- Construct a new array object</DT ><DT ><A HREF="function.arrayobject-count.html" >ArrayObject::count</A > -- Return the number of elements in the Iterator</DT ><DT ><A HREF="function.arrayobject-getiterator.html" >ArrayObject::getIterator</A > -- Create a new iterator from an ArrayObject instance</DT ><DT ><A HREF="function.arrayobject-offsetexists.html" >ArrayObject::offsetExists</A > -- Returns whether the requested $index exists</DT ><DT ><A HREF="function.arrayobject-offsetget.html" >ArrayObject::offsetGet</A > -- Returns the value at the specified $index</DT ><DT ><A HREF="function.arrayobject-offsetset.html" >ArrayObject::offsetSet</A > -- Sets the value at the specified $index to $newval</DT ><DT ><A HREF="function.arrayobject-offsetunset.html" >ArrayObject::offsetUnset</A > -- Unsets the value at the specified $index</DT ><DT ><A HREF="function.cachingiterator-hasnext.html" >CachingIterator::hasNext</A > -- Check whether the inner iterator has a valid next element</DT ><DT ><A HREF="function.cachingiterator-next.html" >CachingIterator::next</A > -- Move the iterator forward</DT ><DT ><A HREF="function.cachingiterator-rewind.html" >CachingIterator::rewind</A > -- Rewind the iterator</DT ><DT ><A HREF="function.cachingiterator-tostring.html" >CachingIterator::__toString</A > -- Return the string representation of the current element</DT ><DT ><A HREF="function.cachingiterator-valid.html" >CachingIterator::valid</A > -- Check whether the current element is valid</DT ><DT ><A HREF="function.cachingrecursiveiterator-getchildren.html" >CachingRecursiveIterator::getChildren</A > -- Return the inner iterator's children as a CachingRecursiveIterator</DT ><DT ><A HREF="function.cachingrecursiveiterator-haschildren.html" >CachingRecursiveIterator::hasChildren</A > -- Check whether the current element of the inner iterator has children</DT ><DT ><A HREF="function.directoryiterator-construct.html" >DirectoryIterator::__construct</A > -- Constructs a new dir iterator from a path</DT ><DT ><A HREF="function.directoryiterator-current.html" >DirectoryIterator::current</A > -- Return this (needed for Iterator interface)</DT ><DT ><A HREF="function.directoryiterator-getatime.html" >DirectoryIterator::getATime</A > -- Get last access time of file</DT ><DT ><A HREF="function.directoryiterator-getctime.html" >DirectoryIterator::getCTime</A > -- Get inode modification time of file</DT ><DT ><A HREF="function.directoryiterator-getchildren.html" >DirectoryIterator::getChildren</A > -- Returns an iterator for the current entry if it is a directory</DT ><DT ><A HREF="function.directoryiterator-getfilename.html" >DirectoryIterator::getFilename</A > -- Return filename of current dir entry</DT ><DT ><A HREF="function.directoryiterator-getgroup.html" >DirectoryIterator::getGroup</A > -- Get file group</DT ><DT ><A HREF="function.directoryiterator-getinode.html" >DirectoryIterator::getInode</A > -- Get file inode</DT ><DT ><A HREF="function.directoryiterator-getmtime.html" >DirectoryIterator::getMTime</A > -- Get last modification time of file</DT ><DT ><A HREF="function.directoryiterator-getowner.html" >DirectoryIterator::getOwner</A > -- Get file owner</DT ><DT ><A HREF="function.directoryiterator-getpath.html" >DirectoryIterator::getPath</A > -- Return directory path</DT ><DT ><A HREF="function.directoryiterator-getpathname.html" >DirectoryIterator::getPathname</A > -- Return path and filename of current dir entry</DT ><DT ><A HREF="function.directoryiterator-getperms.html" >DirectoryIterator::getPerms</A > -- Get file permissions</DT ><DT ><A HREF="function.directoryiterator-getsize.html" >DirectoryIterator::getSize</A > -- Get file size</DT ><DT ><A HREF="function.directoryiterator-gettype.html" >DirectoryIterator::getType</A > -- Get file type</DT ><DT ><A HREF="function.directoryiterator-isdir.html" >DirectoryIterator::isDir</A > -- Returns true if file is directory</DT ><DT ><A HREF="function.directoryiterator-isdot.html" >DirectoryIterator::isDot</A > -- Returns true if current entry is '.' or '..'</DT ><DT ><A HREF="function.directoryiterator-isexecutable.html" >DirectoryIterator::isExecutable</A > -- Returns true if file is executable</DT ><DT ><A HREF="function.directoryiterator-isfile.html" >DirectoryIterator::isFile</A > -- Returns true if file is a regular file</DT ><DT ><A HREF="function.directoryiterator-islink.html" >DirectoryIterator::isLink</A > -- Returns true if file is symbolic link</DT ><DT ><A HREF="function.directoryiterator-isreadable.html" >DirectoryIterator::isReadable</A > -- Returns true if file can be read</DT ><DT ><A HREF="function.directoryiterator-iswritable.html" >DirectoryIterator::isWritable</A > -- Returns true if file can be written</DT ><DT ><A HREF="function.directoryiterator-key.html" >DirectoryIterator::key</A > -- Return current dir entry</DT ><DT ><A HREF="function.directoryiterator-next.html" >DirectoryIterator::next</A > -- Move to next entry</DT ><DT ><A HREF="function.directoryiterator-rewind.html" >DirectoryIterator::rewind</A > -- Rewind dir back to the start</DT ><DT ><A HREF="function.directoryiterator-valid.html" >DirectoryIterator::valid</A > -- Check whether dir contains more entries</DT ><DT ><A HREF="function.filteriterator-current.html" >FilterIterator::current</A > -- Get the current element value</DT ><DT ><A HREF="function.filteriterator-getinneriterator.html" >FilterIterator::getInnerIterator</A > -- Get the inner iterator</DT ><DT ><A HREF="function.filteriterator-key.html" >FilterIterator::key</A > -- Get the current key</DT ><DT ><A HREF="function.filteriterator-next.html" >FilterIterator::next</A > -- Move the iterator forward</DT ><DT ><A HREF="function.filteriterator-rewind.html" >FilterIterator::rewind</A > -- Rewind the iterator</DT ><DT ><A HREF="function.filteriterator-valid.html" >FilterIterator::valid</A > -- Check whether the current element is valid</DT ><DT ><A HREF="function.limititerator-getposition.html" >LimitIterator::getPosition</A > -- Return the current position</DT ><DT ><A HREF="function.limititerator-next.html" >LimitIterator::next</A > -- Move the iterator forward</DT ><DT ><A HREF="function.limititerator-rewind.html" >LimitIterator::rewind</A > -- Rewind the iterator to the specified starting offset</DT ><DT ><A HREF="function.limititerator-seek.html" >LimitIterator::seek</A > -- Seek to the given position</DT ><DT ><A HREF="function.limititerator-valid.html" >LimitIterator::valid</A > -- Check whether the current element is valid</DT ><DT ><A HREF="function.parentiterator-getchildren.html" >ParentIterator::getChildren</A > -- Return the inner iterator's children contained in a ParentIterator</DT ><DT ><A HREF="function.parentiterator-haschildren.html" >ParentIterator::hasChildren</A > -- Check whether the inner iterator's current element has children</DT ><DT ><A HREF="function.parentiterator-next.html" >ParentIterator::next</A > -- Move the iterator forward</DT ><DT ><A HREF="function.parentiterator-rewind.html" >ParentIterator::rewind</A > -- Rewind the iterator</DT ><DT ><A HREF="function.recursivedirectoryiterator-getchildren.html" >RecursiveDirectoryIterator::getChildren</A > -- Returns an iterator for the current entry if it is a directory</DT ><DT ><A HREF="function.recursivedirectoryiterator-haschildren.html" >RecursiveDirectoryIterator::hasChildren</A > -- Returns whether current entry is a directory and not '.' or '..'</DT ><DT ><A HREF="function.recursivedirectoryiterator-key.html" >RecursiveDirectoryIterator::key</A > -- Return path and filename of current dir entry</DT ><DT ><A HREF="function.recursivedirectoryiterator-next.html" >RecursiveDirectoryIterator::next</A > -- Move to next entry</DT ><DT ><A HREF="function.recursivedirectoryiterator-rewind.html" >RecursiveDirectoryIterator::rewind</A > -- Rewind dir back to the start</DT ><DT ><A HREF="function.recursiveiteratoriterator-current.html" >RecursiveIteratorIterator::current</A > -- Access the current element value</DT ><DT ><A HREF="function.recursiveiteratoriterator-getdepth.html" >RecursiveIteratorIterator::getDepth</A > -- Get the current depth of the recursive iteration</DT ><DT ><A HREF="function.recursiveiteratoriterator-getsubiterator.html" >RecursiveIteratorIterator::getSubIterator</A > -- The current active sub iterator</DT ><DT ><A HREF="function.recursiveiteratoriterator-key.html" >RecursiveIteratorIterator::key</A > -- Access the current key</DT ><DT ><A HREF="function.recursiveiteratoriterator-next.html" >RecursiveIteratorIterator::next</A > -- Move forward to the next element</DT ><DT ><A HREF="function.recursiveiteratoriterator-rewind.html" >RecursiveIteratorIterator::rewind</A > -- Rewind the iterator to the first element of the top level inner iterator</DT ><DT ><A HREF="function.recursiveiteratoriterator-valid.html" >RecursiveIteratorIterator::valid</A > -- Check whether the current position is valid</DT ><DT ><A HREF="function.simplexmliterator-current.html" >SimpleXMLIterator::current</A > -- Return current SimpleXML entry</DT ><DT ><A HREF="function.simplexmliterator-getchildren.html" >SimpleXMLIterator::getChildren</A > -- Returns an iterator for the current entry if it is a SimpleXML object</DT ><DT ><A HREF="function.simplexmliterator-haschildren.html" >SimpleXMLIterator::hasChildren</A > -- Returns whether current entry is a SimpleXML object</DT ><DT ><A HREF="function.simplexmliterator-key.html" >SimpleXMLIterator::key</A > -- Return current SimpleXML key</DT ><DT ><A HREF="function.simplexmliterator-next.html" >SimpleXMLIterator::next</A > -- Move to next entry</DT ><DT ><A HREF="function.simplexmliterator-rewind.html" >SimpleXMLIterator::rewind</A > -- Rewind SimpleXML back to the start</DT ><DT ><A HREF="function.simplexmliterator-valid.html" >SimpleXMLIterator::valid</A > -- Check whether SimpleXML contains more entries</DT ><DT ><A HREF="function.class-implements.html" >class_implements</A > -- Return the interfaces which are implemented by the given class </DT ><DT ><A HREF="function.class-parents.html" >class_parents</A > -- Return the parent classes of the given class </DT ><DT ><A HREF="function.iterator-count.html" >iterator_count</A > -- Count the elements in an iterator</DT ><DT ><A HREF="function.iterator-to-array.html" >iterator_to_array</A > -- Copy the iterator into an array</DT ><DT ><A HREF="function.spl-autoload-call.html" >spl_autoload_call</A > -- Try all registered __autoload() function to load the requested class</DT ><DT ><A HREF="function.spl-autoload-extensions.html" >spl_autoload_extensions</A > -- Register and return default file extensions for spl_autoload</DT ><DT ><A HREF="function.spl-autoload-functions.html" >spl_autoload_functions</A > -- Return all registered __autoload() functions</DT ><DT ><A HREF="function.spl-autoload-register.html" >spl_autoload_register</A > -- Register given function as __autoload() implementation</DT ><DT ><A HREF="function.spl-autoload-unregister.html" >spl_autoload_unregister</A > -- Unregister given function as __autoload() implementation</DT ><DT ><A HREF="function.spl-autoload.html" >spl_autoload</A > -- Default implementation for __autoload()</DT ><DT ><A HREF="function.spl-classes.html" >spl_classes</A > -- Return available SPL classes</DT ><DT ><A HREF="function.spl-object-hash.html" >spl_object_hash</A > -- Return hash id for given object </DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.socket-write.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.arrayiterator-current.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >socket_write</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >ArrayIterator::current</TD ></TR ></TABLE ></DIV ></BODY ></HTML >