Linked Questions
14 questions linked to/from How to create a random string using PHP?
40
votes
8
answers
74k
views
What is the best way to generate a random key within PHP?
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 ...
-1
votes
2
answers
3k
views
PHP: Generating random string with both suffix and prefix as capital letters
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 ...
4
votes
3
answers
935
views
PHP, generate string with format, check against SQL db? [closed]
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 ...
0
votes
6
answers
4k
views
generate random number with php and then submit to database
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
user849137
4
votes
3
answers
4k
views
PHP generate a unique string
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 ...
1
vote
3
answers
5k
views
How to generate a unique token that is valid until it's manually reset, in PHP?
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 ...
3
votes
3
answers
698
views
"Unique 7 character string" - related issue
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
Randomly generating a character?
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
Generate random code with PHP [closed]
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 ...
0
votes
2
answers
280
views
PHP: Random ID illegal character
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
user2646450
-1
votes
3
answers
151
views
Iterate through n bit chunks of a byte string
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?
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
PHP Social Network - uploaded picture URL
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
how to find the number of repeating strings and their array index in a string array in matlab
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' '...