<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 15:32:48 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sameer Borate's Blog: How not to create a Random string]]></title>
      <guid>http://www.phpdeveloper.org/news/15498</guid>
      <link>http://www.phpdeveloper.org/news/15498</link>
      <description><![CDATA[<p>
In <a href="http://www.codediesel.com/php/how-not-to-create-a-random-string/">this latest post</a> to his blog, <i>Samer Borate</i> talks about how not to create random strings and how, if you're not careful, it could backfire on you.
</p>
<blockquote>
It is surprising to see how after all the code floating around people still find it hard to create random numbers. In a recent piece of code I encountered, the following was used to generate a string of random numbers. The code was written to provide a random string to be passed to a email verifier system - the type wherein a new user when he subscribes to a website needs to verify his email by clicking on a provided link.
</blockquote>
<p>
He includes a snippet of the code that uses a call to <a href="http://php.net/str_shuffle">str_shuffle</a> on the set of numbers 1-10 to generate a random number. The only problem with the method is that, when the number gets large enough, PHP would automatically kick it into exponential format - not exactly ideal for an email link. Let this serve as a reminder for any scripts you might make that are similar.
</p>]]></description>
      <pubDate>Fri, 26 Nov 2010 10:18:48 -0600</pubDate>
    </item>
  </channel>
</rss>
