title: way to php explode abbreviations to output full text with hyperkinks
body: <p>Current scenario:</p>
  
  <p>Table 'topic' may contain row 'type' that contains abbreviations for:</p>
  
  <ul>
  <li>Web - W, </li>
  <li>Email - E, </li>
  <li>Phone - P</li>
  </ul>
  
  <p>so</p>
  
  <pre><code>if ( isset($topic['type'])) {
  echo $topic['type'];
  </code></pre>
  
  <p>could typically output </p>
  
  <pre><code>W P
  </code></pre>
  
  <p>My question is how to to output full text rather than abbreviations and have hyperlinks from the full text to a url, eg:</p>
  
  <pre><code>&lt;a href='somesite.com/web'&gt;Web&lt;/a&gt; &lt;a href='somesite.com/phone'&gt;Phone&lt;/a&gt;
  </code></pre>
  
  <p>What I have so far:</p>
  
  <pre><code>if ( isset($topic['type'])) {
      $typeArr = explode(' ',$topic['type']);
      $fulldesc = array(
          'W' =&gt; $lang['textentryW'], // textentryW equals Web
          'E' =&gt; $lang['textentryE'], // Email
          'P' =&gt; $lang['textentryP'], // Phone
      );
      foreach ($fulldesc as $abc =&gt; $name) {
          if(in_array($abc, $typeArr))
              // mental blank !!!
      }
  </code></pre>