title: How to get a values from array and display as select list option
body: <p>In the database for WordPress in one of the plugins the values where entered as array into the fields from the admin. Now I want to get the values from that array and display in the page.</p>
  
  <p>I created a function, This works fine.</p>
  
  <pre><code>// Pull district from database
  function get_district(){
      global $wpdb;
      $current_demand = get_metadata('post', 205, 'field_52a7cb0d1edb0');
      return $current_demand;
  }
  </code></pre>
  
  <p>On the page where I want to use the array values I did the var_dump to check for the results. This also works great</p>
  
  <pre><code>var_dump(get_district());
  </code></pre>
  
  <p>The values returns from the results where in this format. From what I can say is that its a array.</p>
  
  <pre><code>array(1) { 
    [0]=&gt; array(12) { 
      ["key"]=&gt; string(19) "field_52a7cb0d1edb0" 
      ["label"]=&gt; string(8) "District" 
      ["name"]=&gt; string(8) "district" 
      ["type"]=&gt; string(6) "select" 
      ["instructions"]=&gt; string(0) "" 
      ["required"]=&gt; string(1) "0" 
      ["choices"]=&gt; array(10) { 
          ["suva"]=&gt; string(4) "Suva" 
          ["nausori"]=&gt; string(7) "Nausori" 
          ["nadi"]=&gt; string(4) "Nadi" 
          ["lautoka"]=&gt; string(7) "Lautoka" 
          ["ba"]=&gt; string(2) "Ba" 
          ["tavua"]=&gt; string(5) "Tavua" 
          ["rakiraki"]=&gt; string(8) "RakiRaki" 
          ["tailevu"]=&gt; string(7) "Tailevu" 
          ["navua"]=&gt; string(5) "Navua" 
          ["labasa"]=&gt; string(6) "Labasa" 
      } 
      ["default_value"]=&gt; string(0) "" 
      ["allow_null"]=&gt; string(1) "0" 
      ["multiple"]=&gt; string(1) "0" 
      ["conditional_logic"]=&gt; array(3) { 
          ["status"]=&gt; string(1) "0" 
          ["rules"]=&gt; array(1) { 
              [0]=&gt; array(2) { 
                  ["field"]=&gt; string(4) "null" 
                  ["operator"]=&gt; string(2) "==" 
              } 
          } 
          ["allorany"]=&gt; string(3) "all" 
      } 
      ["order_no"]=&gt; int(1) 
    } 
  }
  </code></pre>
  
  <p>So What I did next was to break it down and look for the specific values from the array. Now I' am running this code on the function</p>
  
  <pre><code>    foreach(get_district() as $district =&gt; $key){
          $test = $key["choices"];
          var_dump($test);
      }
  </code></pre>
  
  <p>The results returned from above code was</p>
  
  <pre><code>array(10) { 
      ["suva"]=&gt; string(4) "Suva" 
      ["nausori"]=&gt; string(7) "Nausori" 
      ["nadi"]=&gt; string(4) "Nadi" 
      ["lautoka"]=&gt; string(7) "Lautoka" 
      ["ba"]=&gt; string(2) "Ba" 
      ["tavua"]=&gt; string(5) "Tavua" 
      ["rakiraki"]=&gt; string(8) "RakiRaki" 
      ["tailevu"]=&gt; string(7) "Tailevu" 
      ["navua"]=&gt; string(5) "Navua" 
      ["labasa"]=&gt; string(6) "Labasa" 
  }
  </code></pre>
  
  <p><strong>Here's my question, How can I now get the values from here to a select list. This are correct values that I want to use inside the select list. This is the first time am seeing something like this.</strong></p>