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 8732255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:24:19+00:00 2026-06-13T09:24:19+00:00

I am trying to shorten my coding and I am having a problem here.

  • 0

I am trying to shorten my coding and I am having a problem here.

I have this very long array list

array(stackoverflow1,
stackoverflow2,
stackoverflow3,
stackoverflow4,
stackoverflow5,
stackoverflow6........stackoverflow100);

I tried to do something like this

array (
for ($i = 1; $i<100; $i++)
{"stackoverflow".$i,}
);

I tried many ways to clear the syntax error, it just does not work. Is there a way to create a loop within a array?

  • 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-13T09:24:21+00:00Added an answer on June 13, 2026 at 9:24 am

    No, you cannot do what you’re trying to do. That is completely unsupported syntax. You cannot mix executable code with array declarations.

    You can, however, declare an empty array, and append items to it:

    $items = array();
    
    for ($i = 1; $i <= 100; ++$i) {
      $item[] = "stackoverflow$i";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m trying to shorten my code using the ternary operator. This is my original
Is this possible, or am I just trying to way overly shorten my code?
Im trying to shorten a url using ggole api's.Here is my php code .It
I'm trying to trim and shorten some HTML. I use this code: $(window).bind(load, function()
I have been trying to make this search engine for a MySQL database. Taking
I have the following code but I'm trying to shorten it about one or
I'm trying to shorten a wordpress title to just the first word. For a
I need some help. I am trying to shorten a full product name from
The shorter top section of this post is what I'm trying to do. The
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the

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.