note 103993 added to xmlreader.read
| From: | andy at siliconrockstar dot com | Date: | Mon, 16 May 2011 08:01:19 +0000 |
| Subject: | note 103993 added to xmlreader.read | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179750@lists.php.net to get a copy of this message | ||
A very simple way to avoid typing $reader->read() multiple times when you want to skip some
nodes:
class smartXMLReader extends XMLReader {
public function readTimes($count) {
$i = 0;
while($i < $count){
$this->read();
$i++;
}
}
}
Using this smartXMLReader,
$reader->readTimes(3);
is equivalent to
$reader->read();
$reader->read();
$reader->read();
Makes getting around in your XML document a bit easier :)
----
Server IP: 69.147.83.197
Probable Submitter: 76.185.85.192
----
Manual Page -- http://www.php.net/manual/en/xmlreader.read.php
Edit -- https://master.php.net/note/edit/103993
Del: integrated -- https://master.php.net/note/delete/103993/integrated
Del: useless -- https://master.php.net/note/delete/103993/useless
Del: bad code -- https://master.php.net/note/delete/103993/bad+code
Del: spam -- https://master.php.net/note/delete/103993/spam
Del: non-english -- https://master.php.net/note/delete/103993/non-english
Del: in docs -- https://master.php.net/note/delete/103993/in+docs
Del: other reasons-- https://master.php.net/note/delete/103993
Reject -- https://master.php.net/note/reject/103993
Search -- https://master.php.net/manage/user-notes.php