<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Generate Random String'</title>
    <description>Snipplr comments feed</description>
    <link>https://ipv6.snipplr.com/</link>
    <lastBuildDate>Wed, 22 Apr 2026 12:47:04 +0000</lastBuildDate>
    <item>
      <title>Sverri said on 16/Aug/2010</title>
      <link>https://ipv6.snipplr.com/view/39089/generate-random-string</link>
      <description>&lt;p&gt;&lt;p&gt;There is no reason to use a loop. Just shuffle the string and take out the segment you need.&lt;/p&gt;&#13;
&#13;
&lt;pre&gt;function str_rand($len=10) {&#13;
  $shuffled = str_shuffle('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');&#13;
  return substr($shuffled, 0, $len);&#13;
}&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 16 Aug 2010 07:00:47 UTC</pubDate>
      <guid>https://ipv6.snipplr.com/view/39089/generate-random-string</guid>
    </item>
    <item>
      <title>stamba said on 23/Dec/2010</title>
      <link>https://ipv6.snipplr.com/view/39089/generate-random-string</link>
      <description>&lt;p&gt;I have tested this code to generate 404 32-chars long strings. Lengths of the strings are between 30 and 33 chars. &#13;
Code that Sverri posted works like a charm! I got all unique strings and they were all 32 chars long.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Dec 2010 22:25:59 UTC</pubDate>
      <guid>https://ipv6.snipplr.com/view/39089/generate-random-string</guid>
    </item>
  </channel>
</rss>
