Linked Questions

14 questions linked to/from How to create a random string using PHP?
40 votes
8 answers
74k views

I'm looking to create a reusable function that will generate a random key with printable ACSII characters of chosen length (anywhere from 2 to 1000+). I'm thinking printable ASCII characters would be ...
Darryl Hein's user avatar
-1 votes
2 answers
3k views

Hie guys i want to create a random string of numbers where there is a fixed letter B at the beginning and a set of eight integers ending with any random letter, like for example B07224081A where A and ...
alicemap's user avatar
4 votes
3 answers
935 views

I'm trying to use PHP as a way to process this in a webpage, my typical language is java so i am unfamiliar with how this would be done for product keys. This is basically the process: 1. Generate ...
user2816960's user avatar
0 votes
6 answers
4k views

I was wondering how to generate a random 9 digit number with php after a html form submit. in english: I have a form on my site....which posts data to a database. I would like to add another ...
user avatar
4 votes
3 answers
4k views

I have an ID column in a table which stores the row ID number (auto increment), For example 1, 2, 3. I want to generated a random and unique string which could contain only numbers, alphabets and dash ...
sunjie's user avatar
  • 2,053
1 vote
3 answers
5k views

I need some way to generate a unique token that can be passed to a MySQL database, and stored there until it's manually reset. So it needs to be a random token that will be displayed to a user which ...
Sky Davis's user avatar
  • 127
3 votes
3 answers
698 views

I read several topics similar to what I'm asking, but none of them seemed to be very helpful to me. I have a form where users can generate codes that are stored in a column with a Unique constraint. ...
0 votes
5 answers
119 views

I'm randomly generating chars in PHP, using: for ($i = 0; $i < $length; $i++) { $generatedCode .= chr(rand(97, 122)); } But I dont want the letters "g" and "m" to be in the randomly ...
beans's user avatar
  • 1,765
-4 votes
1 answer
498 views

I want to generate a code randomly with php. The length should be 5 alphanumeric chars. But I want the first value to be A-Z. How can I do that? I've done the following, but this seemed too obvious ...
Vay's user avatar
  • 117
0 votes
2 answers
280 views

I have tried it standalone many many times and i got no ID with illegal character. Well, But when the code below working on my website, it is generating illegal characters like: XY�DV3VD, L6XÝOMJ3 ...
user avatar
-1 votes
3 answers
151 views

I have a code like this: $alphabet = array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); $...
inf3rno's user avatar
  • 26.3k
-3 votes
2 answers
144 views

How this JavaScript generate character? I want make PHP version. This is packed JavaScript code (function(options, lary) { eval((function(g6) { for (var R6 = "", c6 = 0, Q6 = function(g6, C6) { ...
-2 votes
1 answer
80 views

I want to know what strategy should i use to generate a random URL for my users uploaded pictures. I dont think str_shuffle is a good option, because it consumes a lot of memory ( am i wrong )? Please ...
1 vote
1 answer
54 views

I have a long array (1x75000 !) of string data. In this array, there are repeated strings. i want to find the array indices and the number of each repeating string. E.g. A=['abc' 'efg' 'hij' 'abc' '...