Generate an N-digit random number

0 votes

I want to generate a 6-digit random number using the PHP mt_rand() function.

I know the PHP mt_rand() function only takes 2 parameters: a minimum and a maximum value.

How can I do that?

Jun 17 in PHP by narikkadan
• 10,840 points
6 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to convert an image to base64 encoding?

Hello @kartik, You can also do this via ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,720 points
2,090 views
0 votes
1 answer

How to pass an array within a query string?

Hello, Submitting multi-value form fields, i.e. submitting arrays ...READ MORE

answered Apr 8, 2020 in PHP by Niroj
• 82,720 points
9,773 views
0 votes
1 answer

I am trying to run following command But I end up with an error :

Hello Nishant, You are getting this error because your ...READ MORE

answered Apr 9, 2020 in PHP by Niroj
• 82,720 points
229 views
0 votes
1 answer

How to resolve “must be an instance of string, string given” prior to PHP 7?

Hello, Prior to PHP 7 type hinting can only be ...READ MORE

answered Apr 20, 2020 in PHP by I Navin
• 220 points
2,764 views
0 votes
1 answer

How to put an 'if clause' in an SQL string?

Hello @kartik, For your specific query, you can ...READ MORE

answered Jun 1, 2020 in PHP by Niroj
• 82,720 points
205 views
0 votes
1 answer

How can I do an UPDATE statement with JOIN in SQL Server?

Hello @kartik, This should work in SQL Server: update ...READ MORE

answered Jul 21, 2020 in PHP by Niroj
• 82,720 points
254 views
0 votes
0 answers

Encrypt and Decrypt md5

I am using code $enrypt=md5($pass) and inserting ...READ MORE

Jun 9 in PHP by Kichu
• 19,040 points
5 views
0 votes
0 answers

php extension mcrypt must be loaded

When I tried to install Magento on ...READ MORE

Jun 16 in PHP by narikkadan
• 10,840 points
8 views
0 votes
0 answers

php error: The Encrypt library requires the Mcrypt extension in codeigniter

I have a  login and sign-up form and ...READ MORE

Jun 20 in PHP by Kithuzzz
• 320 points
3 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
524 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP