title: Is PHP uniqid safe for HTML id attribute?
body: <p>I'd like to use a random <code>id</code> attribute in HTML:</p>
  
  <pre class="lang-none prettyprint-override"><code>&lt;?php $id = uniqid(); ?&gt;
  &lt;div data-cycle-prev="#&lt;?php echo $id; ?&gt;_slideshow_prev"&gt;
      &lt;div id="&lt;?php echo $id; ?&gt;_slideshow_prev"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I'm using PHP method <code>uniqid</code> to generate it, but I don't know if it is safe and W3C compliant?</p>
  
  <p>My concern for compliance is for the generated HTML which the PHP outputs. Not all characters are allowed in an HTML attribute, so I was wondering if <code>uniqid()</code> generates only allowed characters.</p>