title: How to add html to an array in php?
body: <p>I am trying to add some html code before each tag printed as an array element. &nbsp;
  <br><strong>My code:</strong></p>
  
  <pre><code>  $term_links = array();
  
    foreach ($vars['node']-&gt;taxonomy as $term) 
    {
      $term_links[] = l($term-&gt;name, 'taxonomy/term/' . $term-&gt;tid,
        array(
          'attributes' =&gt; array(
            'title' =&gt; $term-&gt;description
      )));
    }
  
    $vars['node_terms'] = implode(', ', $term_links);
  </code></pre>
  
  <p>At the moment the tags are printed seperated by a comma. I would like to add a small image before each tag element using <code>img src="tag.png"</code>  <strong>How can I do this?</strong></p>
  
  <p><strong>EDIT - My current Code, still not working.</strong></p>
  
  <pre><code> if (module_exists('taxonomy')) {
  
  $img  = 'some html';
  $text = $img . $term-&gt;name;
  $path = 'taxonomy/term/' . $term-&gt;tid;
  
  
  $term_links = array();
  foreach ($vars['node']-&gt;taxonomy as $term) {
  
  
  
    $term_links[] = l($text, $path, array(
      'html' =&gt; TRUE,
        'attributes' =&gt; array(
          'title' =&gt; $term-&gt;description
      )));
   }
     $vars['node_terms'] = implode(', ', $term_links);
   }
  }
  </code></pre>