About recursiveiteratoriterator several parameters test results

Source: Internet
Author: User
Manual documentation for these parameter comments are all empty, to self-write program test ... Alas

Just look at the name. Recursiveiteratoriterator is a recursive iterator, followed by an optional four parameter (only any one)

Recursiveiteratoriterator::leaves_only
By default, the usage is set in the __construct
The function is to leave the leaves of the branches, skip the empty nodes, and recursively take the real value.
Example is
1. Recursive folder to skip the folder itself, only the folder under the file, the output of all files (files and subfolders of all levels)
2. Multi-dimensional arrays skip the first few dimensions of key, and value, each output is not an array
3.XML only value (text), do not output node name, of course, depending on your settings to get the XML what content

Recursiveiteratoriterator::self_first
Items, such as a recursive folder, are also exported as a subfolder name, in the order that the

Recursiveiteratoriterator::child_first
Ditto, but the order is the first son stepfather,./test/test.php will be in front of./test (folder)

Recursiveiteratoriterator::catch_get_child
It is not clear that the test results, like leaves_only, are estimated to take only children, such as two-level elements that contain real values and three-level elements when only the subordinate elements are taken?
Who knows, to add to this.



In addition, nagging, the last problem know the correct wording, recursive function written in the class to use Recursivecallbackfilteriterator this


Reply to discussion (solution)

Well, it's a personal pick-up, and I'm a good knot-stick.

http://www.kittencup.com/standard-php-library-%E8%BF%AD%E4%BB%A3%E5%99%A8-recursiveiteratoriterator/

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.