Loading:


    SimpleXMLElement children
    SimpleXMLElement
    SimpleXMLElement children ([ string $ns [, bool $is_prefix ]] )

    Ta metoda stwierdza element dzieci , który jest rezultatem następujących normalnych zasad iteracji.

     

    Parametry

     

    ns

     

    is_prefix-  domyślnie false


    Napisz Artyku³

    Listing


    //Przykład # dzieci znajdujące się w () pseudo-tablicy

    <?php
    $xml = new SimpleXMLElement(
    '<person>
     <child role="son">
      <child role="daughter"/>
     </child>
     <child role="daughter">
      <child role="son">
       <child role="son"/>
      </child>
     </child>
    </person>'
    );

    foreach ($xml->children() as $second_gen) {
        echo ' The person begot a ' . $second_gen['role'];

        foreach ($second_gen->children() as $third_gen) {
            echo ' who begot a ' . $third_gen['role'] . ';';

            foreach ($third_gen->children() as $fourth_gen) {
                echo ' and that ' . $third_gen['role'] .
                    ' begot a ' . $fourth_gen['role'];
            }
        }
    }
    ?>

    // Powyższy przykład wyświetli:

    The person begot a son who begot a daughter; The person
    begot a daughter who begot a son; and that son begot a son


       

     




    Dodano przez: igor
    Ranga: Administrator serwisu Punktów: 0
    Komentarze użytkowników
      • Tre¶æ komentarza
        Kod do komentarza (opcjonalnie)
        PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
        Autor
        Token
        token

         

         








    funkcje.net
    Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-2025 v.1.5 | design: diviXdesign & rainbowcolors