spl 教程一 基础应用


spl 是什么

* SPLStandard PHP LibraryPHP标准库)的缩写。
*
根据官方定义,它是“a collection of interfaces and classes that are meant tosolve standard problems
*
目前在使用中,SPL更多地被看作是一种使object(物体)模仿array(数组)行为的interfacesclasses




spl可以干什么用

 /**
         * spl 作用
         * (1) 提供了一系列的标准的数据机构
                    SplDoublyLinkedList — The SplDoublyLinkedList class
                    SplStack — The SplStack class
                    SplQueue — The SplQueue class
                    SplHeap — The SplHeap class
                    SplMaxHeap — The SplMaxHeap class
                    SplMinHeap — The SplMinHeap class
                    SplPriorityQueue — The SplPriorityQueue class
                    SplFixedArray — The SplFixedArray class
                    SplObjectStorage — The SplObjectStorage class
         * (2) 提供了一系列迭代器
                    AppendIterator — The AppendIterator class
                    ArrayIterator — The ArrayIterator class
                    CachingIterator — The CachingIterator class
                    CallbackFilterIterator — The CallbackFilterIterator class
                    DirectoryIterator — The DirectoryIterator class
                    EmptyIterator — The EmptyIterator class
                    FilesystemIterator — The FilesystemIterator class
                    FilterIterator — The FilterIterator class
                    GlobIterator — The GlobIterator class
                    InfiniteIterator — The InfiniteIterator class
                    IteratorIterator — The IteratorIterator class
                    LimitIterator — The LimitIterator class
                    MultipleIterator — The MultipleIterator class
                    NoRewindIterator — The NoRewindIterator class
                    ParentIterator — The ParentIterator class
                    RecursiveArrayIterator — The RecursiveArrayIterator class
                    RecursiveCachingIterator — The RecursiveCachingIterator class
                    RecursiveCallbackFilterIterator — The RecursiveCallbackFilterIterator class
                    RecursiveDirectoryIterator — The RecursiveDirectoryIterator class
                    RecursiveFilterIterator — The RecursiveFilterIterator class
                    RecursiveIteratorIterator — The RecursiveIteratorIterator class
                    RecursiveRegexIterator — The RecursiveRegexIterator class
                    RecursiveTreeIterator — The RecursiveTreeIterator class
                    RegexIterator — The RegexIterator class
         *
         *
         * (3) 提供了一系列接口
                    Countable — The Countable interface
                    OuterIterator — The OuterIterator interface
                    RecursiveIterator — The RecursiveIterator interface
                    SeekableIterator — The SeekableIterator interface
         * (4) 提供了一系列标准异常
                    BadFunctionCallException — The BadFunctionCallException class
                    BadMethodCallException — The BadMethodCallException class
                    DomainException — The DomainException class
                    InvalidArgumentException — The InvalidArgumentException class
                    LengthException — The LengthException class
                    LogicException — The LogicException class
                    OutOfBoundsException — The OutOfBoundsException class
                    OutOfRangeException — The OutOfRangeException class
                    OverflowException — The OverflowException class
                    RangeException — The RangeException class
                    RuntimeException — The RuntimeException class
                    UnderflowException — The UnderflowException class
                    UnexpectedValueException — The UnexpectedValueException class
         *  (5) 一系列方法
                    class_implements — Return the interfaces which are implemented by the given class or interface
                    class_parents — Return the parent classes of the given class
                    class_uses — Return the traits used by the given class
                    iterator_apply — Call a function for every element in an iterator
                    iterator_count — Count the elements in an iterator
                    iterator_to_array — Copy the iterator into an array
                    spl_autoload_call — Try all registered __autoload() function to load the requested class
                    spl_autoload_extensions — Register and return default file extensions for spl_autoload
                    spl_autoload_functions — Return all registered __autoload() functions
                    spl_autoload_register — Register given function as __autoload() implementation
                    spl_autoload_unregister — Unregister given function as __autoload() implementation
                    spl_autoload — Default implementation for __autoload()
                    spl_classes — Return available SPL classes
                    spl_object_hash — Return hash id for given object
         *
         *
         */



spl 案例和应用



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值