Fetch the value from the key PHP
<p>I have a wordy value array without explisit keys for speed reason. And the keys are populated as numeric keys 0-N automatically:</p>

<pre><code>$array = array('Good old days', 'Bad old days', ....);
</code></pre>

<p>The form is filled up with expected key|value pairs:</p>

<pre><code>key=0, value=Good old days
</code></pre>

<p>or</p>

<pre><code>&lt;option value="0"&gt;Good old days&lt;/option&gt;
</code></pre>

<p>which is good as I don't want to have long wordy keys.</p>

<p>Now the issue part is, I know how to fetch the key, but I can not find a way how to display the value out of the given key. Maybe because I have to loop for a condition and than the key is grabbed if the condition met.</p>

<p>How do you grab the value from the given key?</p>

<p>Any hint would be very much appreciated.</p>

<p><strong>UPDATE:</strong></p>

<pre><code>  //If keys are wordy: http://fonts.googleapis.com/css?family=Quattrocento|Droid+Sans|Yanone+Kaffeesatz

  $gwf_settings = array(
    'base_font',
    'article_title',
    'site_name',
    'site_slogan',   
  );


  $gwfs = array();
  foreach($gwf_settings as $key =&gt; $gwf_font) { 
    //dsm('KEYS: '. $key); 
    // parent form to check condition if we are using gwf
        if (theme_get_setting($gwf_font) == 'gwf') {
          $values = $gwfs[theme_get_setting($gwf_font .'_gwf')];
            dsm('KEY2: '. theme_get_setting($gwf_font .'_gwf')); //ok, we have the gwf key
            dsm('VALUES: '. $values); // BLANK        
$gwfs[] = str_replace(' ', '+',  $values);
        }       
  }    

  $google_web_fonts = implode('|', $gwfs);
</code></pre>

<p>I seem to get stucked with "values".</p>

<p><strong>UPDATE 2</strong>, in case useful to anyone, or any betterment:</p>

<pre><code>          $gwf_settings = array(
            'base_font',
            'article_title',
            'site_name',
            'site_slogan',   
          );

          $gwf_gwf = array(
            'base_font_gwf',
            'article_title_gwf',
            'site_name_gwf',
            'site_slogan_gwf',   
          );  

          foreach($gwf_settings as $key =&gt; $gwf_font) {     
            if ( theme_get_setting($gwf_font) == 'gwf' ) {       
              $gwfs = array();
              foreach ($gwf_gwf as $k =&gt; $gwf_setting) {   
                $s = theme_get_setting($gwf_setting);         
                $fonts = get_gwf();     
                if ( $s ) { 
                  foreach ($fonts as $f =&gt; $val) {
                    if ( $f == $s ) {                 
                      $gwfs[] = str_replace(' ', '+',  $val);
                    }
                  }
                }
              }
            }
          }   

          $google_web_fonts = implode('|', $gwfs); 

        // The final output will be just like with wordy key version: 
//http://fonts.googleapis.com/css?family=Oswald|Yanone+Kaffeesatz|Droid+Sans
</code></pre>
