About 552,000 results
Open links in new tab
  1. PHP random string generator - Stack Overflow

    Dec 5, 2010 · I'm trying to create a randomized string in PHP, and I get absolutely no output with this: function RandomString() $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randstring = ''; for ($i = 0; $i < 10; $i++) { $randstring = $characters[rand(0, strlen($characters))]; return $randstring; RandomString();

  2. php - How to generate a random, unique, alphanumeric string?

    Dec 6, 2016 · If you want to generate a unique string in PHP, try following. md5(uniqid().mt_rand()); In this, uniqid() - It will generate unique string. This function returns timestamp based unique identifier as a string. mt_rand() - Generate random number. md5() - It will generate the hash string.

  3. Random String Generator (PHP) - Stack Overflow

    Try eliminating certain characters from being concatenated to the string. This function will work to generate a random string in PHP. $randomString=null; //initalise the string include lower case, upper case and numbers. $charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

  4. How to Generate a Random String with PHP - W3docs

    This tutorial includes several methods of generating a unique, random, alpha-numeric string with PHP. Follow the examples below, it will be easily done.

  5. Generating Random String Using PHP - GeeksforGeeks

    Sep 19, 2024 · Generating a random string involves creating a sequence of characters where each character is selected unpredictably from a defined set (e.g., letters, numbers, symbols). This process is used in programming to produce unique identifiers, passwords, tokens, or keys for security and randomness in applications.

  6. PHP: 4 Ways to Generate a Random String - Sling Academy

    Jan 9, 2024 · PHP provides several methods to generate random strings. This post outlines different approaches, their implementation, and considerations. The MD5 hashing algorithm can be used to generate a hex string from some unique data.

  7. 8 Ways to Generate Random String in PHP Tutorial

    Nov 21, 2022 · A step-by-step tutorial with snippets of 8 Different Ways of Generating Random Strings using PHP Built-it Methods or Functions. A sample source code that demonstrates this is provided and free to download.

  8. PHP guide: How to Generate Random String | Kodersolution

    Apr 27, 2025 · Generating random strings in PHP is a breeze with a few lines of code. In this comprehensive guide, we'll explore various methods to generate random strings in PHP along with practical examples. Why Generate Random Strings?

  9. Simple PHP Random String Generation - written.dev

    Jan 5, 2024 · Generating random strings in PHP is a versatile process that can be tailored to fit specific requirements. Whether you need a quick hash, a unique identifier, or a simple random string, PHP provides the tools to achieve this with ease.

  10. How to create a random string in PHP - BackEndTea

    Jun 4, 2024 · Use the Randomizer class to generate a random string, based on an input string.

  11. Some results have been removed
Refresh