Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 4
    strlen($characters) => strlen($characters) - 1 - string length starts with 1 Commented Apr 24, 2017 at 13:07
  • Simple command: php -r "echo sha1(rand());" Commented Mar 14, 2018 at 1:25
  • nedd add a period fefore asing randstring like $randString .= $characters Commented Aug 5 at 20:27
  • if character is last, get error, need reduce value in one, final version: $randString .= $characters[rand(0, strlen($characters)-1)]; Commented Aug 5 at 20:31