title: Using Data attributes With Data from an array
body: <p>I am using data-attributes in my portal page to describe favorite links.  This is very easy to do it you are using a regular list ( because you can individually put the custom "data-special" in.</p>
  
  <p>However when you have lots of links in an array and you are using foreach <li> <strong>how do you pick out and apply a data-special to individual links within the array?</strong> ?  the way I see it its either all or none within the foreach.</p>
  
  <p>data-special is my own declaration. I apply a Unicode character through CSS to the links that are special.</p>
  
  <p>Thank you for reading and your time.</p>
  
  <pre><code> $portal = array(
  
      "Twitter" =&gt; "http://twitter.com",
      //another 20 array elements       
  );  
  ksort($portal);
  
  foreach ($portal as $key =&gt; $item): 
     echo("&lt;li&gt;&lt;a rel=\"external\" href=\"$item\"&gt;$key&lt;/a&gt;&lt;/li&gt;");    
  ?&gt;  
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>I need to add data-special to specific links but am unsure of how to pick them out as they are in an array</p>
  
  <p>EDIT
  This is what I am trying to achieve on perhaps 5 of some links in the array</p>
  
  <pre><code>&lt;li data-special&gt;&lt;a href="http://kuler.adobe.com/#create/fromacolor" rel="external"&gt;Kular&lt;/a&gt;&lt;/li&gt;
  </code></pre>