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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:22:53+00:00 2026-06-06T09:22:53+00:00

Here is what I am doing (php) <?php for($i = 0; $i <= 30;

  • 0

Here is what I am doing (php)

<?php

for($i = 0; $i <= 30; $i+2)
{
  echo $i;
}
?>

It drives me nuts,coz it does not work [prints nothing, browser keeps trying to load]. But if I change $i+2 to $i++, it works, and if I change it to $i+1, that does not work either.

I am out of my wits. What is going wrong?

  • 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-06T09:22:54+00:00Added an answer on June 6, 2026 at 9:22 am

    It drives me nuts,coz it does not work [prints nothing, browser keeps trying to load]. But if I change $i+2 to $i++, it works, and if I change it to $i+1, that does not work either.

    $i++ is equivalent to $i = $i + 1, note the assignment operator =, it isn’t present here $i + 2 adds but doesn’t update …

    since $i is never updated, you have an infinite loop, where the script will probably reach the allowable time for processing and terminate.

    http://php.net/manual/en/function.set-time-limit.php

    Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's what I am doing, <?php if(isset($_POST['submit'])){ $text_area= mysqli_real_escape_string($dbc, strip_tags(trim($_POST['text_area']))); echo $text_area; } ?>
I'm doing the following: <?php echo $this->Html->link('click here', 'www.notw.com', array('target' => '_blank')); ?> Still,
Here is what I am currently doing. PHP echo's out the recent post in
What am I doing wrong here folks? <?php include 'header.php'; /** * Display a
I am not sure what I should be doing here. Should I be hardcoding
What am I doing wrong here? I'm trying to get started with jQuery UI
What am I doing wrong here? Im trying to save a canvas drawing by
What am I doing wrong here? Declare @starttimestamp datetime = getdate(); RAISERROR(N'Code not valid
This is confusing as hell, here's the php I'm using: <?php echo date('H:i D
I'm a newbie programmer doing his best to self learn PHP. I'm trying to

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.