title: Split arrays into separate strings
body: <p>I've got an array see here:</p>
  
  <pre><code>foreach ($fonts as $font) {
  
          $html .= '&lt;option value="'. $font['name'] .''. $font['font'] .''. $font['css'] .'"' . selected( $layout_options['h1-font'], ''. $font['name'] .''. $font['font'] .''. $font['css'] .'', false) . '&gt;' . __( ''. $font['name'] .'' ) . '&lt;/option&gt;';
  
              $html.= $font['font'];
          $html .= '&lt;/option&gt;';
      }
  </code></pre>
  
  <p>The var_dump results for it are here:</p>
  
  <p>Using</p>
  
  <pre><code>var_dump($layout_options['h1-font']
  </code></pre>
  
  <p>I get the results</p>
  
  <pre><code>string(85) "Lobster@import url(http://fonts.googleapis.com/css?family=Lobster);'Lobster', cursive"
  </code></pre>
  
  <p>That array consists of the following variables</p>
  
  <pre><code>'. $font['name'] .''. $font['font'] .''. $font['css'] .'
  </code></pre>
  
  <p>I need to separate them, ideally I would like to use </p>
  
  <pre><code>$layout_options['hi-font-css']
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p>UPDATE:</p>
  
  <p>Hopefully it will explain it more if I post all the code.</p>
  
  <p>Here is my function, i'll go back to the original code as this worked slightly better.</p>
  
  <pre><code>function span_font_callback() {
  $layout_options = (array) get_option( 'layout_options' );
  $fonts = get_fonts();
  $current = 'arial';
  
  if ( isset( $layout_options['span-font'] ) )
      $current = $layout_options['span-font'];
  
  ?&gt;
      &lt;select name="layout_options[span-font]"&gt;
        &lt;option value="default"&gt;Please select an option&lt;/option&gt;
        &lt;?php foreach( $fonts as $key =&gt; $font ): ?&gt;
          &lt;option &lt;?php if($key == $current) echo "SELECTED"; ?&gt; value="&lt;?php echo $key; ?&gt;"&gt;&lt;?php echo $font['name']; ?&gt;&lt;/option&gt;
        &lt;?php endforeach; ?&gt;
      &lt;/select&gt;
      &lt;input type="text" name="layout_options[span_font_size]" size="6" value="&lt;?php echo $layout_options['span_font_size']; ?&gt;" placeholder="Size"/&gt;
      &lt;input type="text" name="layout_options[span_font_colour]" size="6" value="&lt;?php echo $layout_options['span_font_colour']; ?&gt;" placeholder="Colour"/&gt;
  
  &lt;?php   
  }
  </code></pre>
  
  <p>Here's the get_fonts() function</p>
  
  <pre><code>function get_fonts() {
  $fonts = array(
      'arial' =&gt; array(
          'name' =&gt; 'Arial',
          'font' =&gt; '',
          'css' =&gt; "'Arial', sans-serif"
      ),
      'Montez' =&gt; array(
          'name' =&gt; 'Montez',
          'font' =&gt; '@import url(http://fonts.googleapis.com/css?family=Montez);',
          'css' =&gt; "'Montez', cursive"
      ),
      'Open Sans' =&gt; array(
          'name' =&gt; 'Open Sans',
          'font' =&gt; '@import url(http://fonts.googleapis.com/css?family=Open+Sans);',
          'css' =&gt; "'Open Sans', sans-serif"
      ),
      'ubuntu' =&gt; array(
          'name' =&gt; 'Ubuntu',
          'font' =&gt; '@import url(https://fonts.googleapis.com/css?family=Ubuntu);',
          'css' =&gt; "'Ubuntu', sans-serif"
      ),
      'lobster' =&gt; array(
          'name' =&gt; 'Lobster',
          'font' =&gt; '@import url(http://fonts.googleapis.com/css?family=Lobster);',
          'css' =&gt; "'Lobster', cursive"
      )
  );
  
  return apply_filters( 'get_fonts', $fonts );
  </code></pre>
  
  <p>}</p>
  
  <p>And here's my stylesheet.php</p>
  
  <pre><code>&lt;?php $layout_options       = get_option ( 'layout_options' ); ?&gt;
  
  @import url(http://fonts.googleapis.com/css?family=Lobster);
  .hero_text {
  text-align: right;
  padding-left: 5px;
  display: inline;
  float: right;
  clear: both;
  position: fixed;
  right: 0;
  font-family: &lt;?php echo $layout_options['h1-font']; ?&gt;;
  font-size: &lt;?php echo $layout_options['h1_font_size']; ?&gt;;
  color: &lt;?php echo $layout_options['h1_font_colour']; ?&gt;;
  line-height: 20px;
  }
  </code></pre>
  
  <p>I need to replace the</p>
  
  <pre><code>@import url(http://fonts.googleapis.com/css?family=Lobster);
  </code></pre>
  
  <p>with the font array so that when my drop down lists changes, it will change that line to match the font. I need to use something like below but specifically to the array name, css and font?</p>
  
  <pre><code>&lt;?php echo $layout_options['h1-font-']; ?&gt;;
  </code></pre>
  
  <p>Hope this yeps you more?</p>