Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9164719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:44:58+00:00 2026-06-17T14:44:58+00:00

I need to generate two Random numbers using PHP. This is simple but the

  • 0

I need to generate two Random numbers using PHP. This is simple but the condition is that the first number should be smaller than second number in value.

So let’s say I need to generate lower and upper bounds between 10 and 1000. So I will need two random numbers within this range. First number as lower bound (20 may be) and upper bound higher than that in value so (100 may be).

Thanks
Ahmar.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:44:59+00:00Added an answer on June 17, 2026 at 2:44 pm
    $num1 = rand(20, 999);
    $num2 = rand($num1+1, 1000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to generate two numbers that are NOT equal in PHP. I know
I need to generate n random numbers between a and b , but any
I need to generate report that will show number of new / changed rows
Here is a fun one: I need to generate random x/y pairs that are
I need to be able to generate a single random number and then use
Possible Duplicate: Generating random numbers effectively I need to generate random numbers in my
I have an interval consisting of two float numbers, and need to generate 20
I need to generate some token that can only take on a range of
I need to generate Entities/Object from selected tables - not all. Is this possible
I'm trying to generate random numbers from a gaussian distribution. Python has the very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.