Note that there are some explanatory texts on larger screens.

plurals
  1. POmultidimensional array loop
    primarykey
    data
    text
    <p>I have a multidimensional array </p> <pre><code>return array( // This level separates instances by their instance key. 'cytec' =&gt; array( // This level separates models by their model key. 'model1' =&gt; array( 'title' =&gt; 'Business card model 1 title', 'preview' =&gt; 'public path to preview image', 'pdf' =&gt; 'web safe path to PDF to generate from', 'fields' =&gt; array( 'title' =&gt; array( 'label' =&gt; 'Title', 'type' =&gt; 'text', 'required' =&gt; true, 'coordinate-x' =&gt; 30, 'coordinate-y' =&gt; 20, 'rules' =&gt; 'required', ), 'phone' =&gt; array( 'label' =&gt; 'Phone', 'type' =&gt; 'text', 'help' =&gt; 'syntax +32(0)3 485 85 53', 'coordinate-x' =&gt; 40, 'coordinate-y' =&gt; 20, 'rules' =&gt; '', ), 'position' =&gt; array( 'label' =&gt; 'Position', 'type' =&gt; 'select', 'options' =&gt; array( 'developer' =&gt; 'Web Developer', 'designer' =&gt; 'Web Designer', ), 'required' =&gt; true, 'coordinate-x' =&gt; 40, 'coordinate-y' =&gt; 20, 'rules' =&gt; 'required|in:developer,designer', ), ), ), ), ); </code></pre> <p>and I get this returned </p> <pre><code>Array ( [model1] =&gt; Array ( [title] =&gt; Business card model 1 title [preview] =&gt; public path to preview image [pdf] =&gt; web safe path to PDF to generate from [fields] =&gt; Array ( [title] =&gt; Array ( [label] =&gt; Title [type] =&gt; text [required] =&gt; 1 [coordinate-x] =&gt; 30 [coordinate-y] =&gt; 20 [rules] =&gt; required ) [phone] =&gt; Array ( [label] =&gt; Phone [type] =&gt; text [help] =&gt; syntax +32(0)3 485 85 53 [coordinate-x] =&gt; 40 [coordinate-y] =&gt; 20 [rules] =&gt; ) [position] =&gt; Array ( [label] =&gt; Position [type] =&gt; select [options] =&gt; Array ( [developer] =&gt; Web Developer [designer] =&gt; Web Designer ) [required] =&gt; 1 [coordinate-x] =&gt; 40 [coordinate-y] =&gt; 20 [rules] =&gt; required|in:developer,designer ) ) ) ) </code></pre> <p>but now I wan't to loop through this and just get the name of array model1 back.<br> How do I do this? I don't need the values of the array model 1 just the name</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