array child in php
<p>i have this array
the name of array is $list</p>

<p>when i type this:</p>

<pre><code>$mychild = $list[1]['children'];
</code></pre>

<p>but if there is no child i get this message</p>

<p><em>A PHP Error was encountered
Severity: Notice
Message: Undefined index: children
Filename: controllers/user.php
Line Number: 384</em></p>

<p>how i can check if there is child in array items?</p>

<pre><code>Array
    (    
        [0] =&gt; Array
            (
                [id] =&gt; 7
                [children] =&gt; Array
                    (
                        [0] =&gt; Array
                            (
                                [id] =&gt; 9
                            )

                    )

            )

        [1] =&gt; Array
            (
                [id] =&gt; 6
            )

        [2] =&gt; Array
            (
                [id] =&gt; 8
            )

        [3] =&gt; Array
            (
                [id] =&gt; 10
            )

    )
</code></pre>
