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

  • SEARCH
  • Home
  • 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 7886501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:20:02+00:00 2026-06-03T05:20:02+00:00

$cust = rand(50,100); $minutes = rand(200,2500); $minutesarr = array(); function minutesTable() { global $cust,$i,$minutes,$minutesarr;

  • 0
$cust = rand(50,100);
$minutes = rand(200,2500);
$minutesarr = array();
function minutesTable()
{
        global $cust,$i,$minutes,$minutesarr;
        for ($i = 0; $i <= $cust; $i++)
        {
            array_push($minutesarr,$minutes);

        }          
}

I’ve even resorted to using $minutesarr[$i] = $minutes; but that didn’t work either which is strangely mysterious.

Edit: Whoops I forgot to add the $cust variable in the thread. Let me add that in there to prevent confusion.

  • 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-03T05:20:03+00:00Added an answer on June 3, 2026 at 5:20 am

    One of the following must be happening:

    1. The function is never run
    2. $cust is never declared
    3. $cust is less than 1

    So confirm/fix the above and you should be dandy.

    Also I should note that you probably intended the $minutes variable to contain a different number for every loop, but it won’t with your current code. You have to run the rand function again for every loop to get a new number.


    To answer your comment

    Expanding upon your current code:

    $cust = rand(50,100);
    $minutesarr = array();
    function minutesTable()
    {
            global $cust, $minutesarr;
    
            for ($i = 0; $i <= $cust; $i++)
            {
                $minutes = rand(200,2500);
                array_push($minutesarr, $minutes);
            }
    }
    
    // RUN the function :-P
    minutesTable();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using (TransactionScope scope = new TransactionScope()) { int updatedRows1 = custPh.Update(cust.CustomerID, tempPh1, 0); int
public class Order { static Customer cust = new Customer(); string sEmpty = ;
I have the following example in a SQL table Cust Group Sales A 1
I have a fairly standard .Net MVC Controller method: public ActionResult Add(Customer cust) {
IList<Customer> Customers = flat.GroupBy(cust => new { cust.ReferenceNumber, cust.Name, cust.Address }) .Select(c => new
The CUST table below will be joined with ~10 tables. For this subquery in
var customer= from cust in customerData select new Customer { CustomerID = cust[id], Name
I have the following data: cust subject date Cust1 Subject1 2010-12-31 21:59:59.000 Cust1 Subject1
SELECT ['VISA CK - 021810$'].[ACCT NBR #1], ['VISA CK - 021810$'].[ALT CUST NM #1],
I have the following T-SQL: SELECT Cust.[CompanyName] FROM Customers AS Cust WHERE ( Cust.[CompanyName]

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.