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, 2022 in PHP by narikkadan
• 63,600 points
563 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
0 answers

How to generate a create table script for an existing table in phpmyadmin?

How can I generate a create table ...READ MORE

Aug 4, 2022 in PHP by Kithuzzz
• 38,000 points
866 views
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,840 points
4,046 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,840 points
12,392 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,840 points
772 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
5,107 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,840 points
953 views
0 votes
0 answers

Encrypt and Decrypt md5

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

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

php extension mcrypt must be loaded

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

Jun 16, 2022 in PHP by narikkadan
• 63,600 points
407 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, 2022 in PHP by Kithuzzz
• 38,000 points
3,482 views
0 votes
0 answers

PHP random string generator

I want to create a randomized string in ...READ MORE

Jul 26, 2022 in PHP by Kithuzzz
• 38,000 points
1,665 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP