⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class.collectioniterator.php

📁 Professional PHP5 code for this book
💻 PHP
字号:
<?class CollectionIterator implements Iterator {   private $_collection;   private $_currIndex = 0;   private $_keys;   function __construct(Collection $objCol) {     $this->_collection = $objCol;     $this->_keys = $this->_collection->keys();   }   function rewind() {     $this->_currIndex = 0;   }   function hasMore() {     return $this->_currIndex < $this->_collection->length();   }   function key() {     return $this->_keys[$this->_currIndex];   }   function current() {     return $this->_collection->getItem($this->_keys[$this->_currIndex]);   }   function next() {     $this->_currIndex++;   }}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -