Note that there are some explanatory texts on larger screens.

plurals
  1. POWorking with multi-level arrays
    primarykey
    data
    text
    <p>hello i am learning PHP and came upon this multi-level array after using print_r on <code>$this-&gt;root</code></p> <pre><code> Array ( [0] =&gt; 9 [obj] =&gt; 3562 [gen] =&gt; 0 [1] =&gt; Array ( [0] =&gt; 5 [1] =&gt; Array ( [/AcroForm] =&gt; Array ( [0] =&gt; 8 [1] =&gt; 3563 [2] =&gt; 0 ) [/Metadata] =&gt; Array ( [0] =&gt; 8 [1] =&gt; 3559 [2] =&gt; 0 ) [/PageLabels] =&gt; Array ( [0] =&gt; 8 [1] =&gt; 3389 [2] =&gt; 0 ) [/Pages] =&gt; Array ( [0] =&gt; 8 [1] =&gt; 3392 [2] =&gt; 0 ) [/Type] =&gt; Array ( [0] =&gt; 2 [1] =&gt; /Catalog ) ) ) ) Array ( [0] =&gt; 9 [obj] =&gt; 8 [gen] =&gt; 0 [1] =&gt; Array ( [0] =&gt; 5 [1] =&gt; Array ( [/Type] =&gt; Array ( [0] =&gt; 2 [1] =&gt; /Catalog ) [/Pages] =&gt; Array ( [0] =&gt; 8 [1] =&gt; 1 [2] =&gt; 0 ) [/OpenAction] =&gt; Array ( [0] =&gt; 6 [1] =&gt; Array ( [0] =&gt; Array ( [0] =&gt; 8 [1] =&gt; 3 [2] =&gt; 0 ) [1] =&gt; Array ( [0] =&gt; 2 [1] =&gt; /FitH ) [2] =&gt; Array ( [0] =&gt; 0 ) ) ) [/PageLayout] =&gt; Array ( [0] =&gt; 2 [1] =&gt; /OneColumn ) ) ) ) </code></pre> <p>i have an question about the behavior of using multi-level arrays, i want to use this function</p> <pre><code>$pages = $this-&gt;pdf_resolve_object($this-&gt;c, $this-&gt;root[1][1]['/Pages']); </code></pre> <p>and <code>$this-&gt;root[1][1]['/Pages']</code> which i believe is used to check the array for these keys and if it exists then use as variable for pdf_resolve_object</p> <p>so my question is 2-fold, one is does <code>$this-&gt;root[1][1]['/Pages']</code> check the array and goes through the keys? if not what is its behavior? and 2 when it checks the array does it go through just the top 4 keys or all of the sub-keys?</p> <p>If someone can help or link me to some learning material that would be much appreciated, thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload