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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:39:26+00:00 2026-06-17T13:39:26+00:00

I just started learning php and I have to do something like this which

  • 0

I just started learning php and I have to do something like this which I got it working but I just have a few questions I want to ask for alternate way of doing but eh first of all the br/ is suppose to be with <> but somehow if i do that the coding at the bottom will see it as a line break.

Anyways if questions are…

  1. With the coding below the outcome will be 0-9 (without 5) but I have to set $zero=-1 if I put $zero=0 then the outcome would be 1-9 (without 5) is there a way I don’t have to make $zero=-1 and still have the outcome of 0-9 (without 5)?

  2. I realized I have to put $zero++ before the if and continue statement if I put it at the end of the script after echo "$zero" . "br/"; the script won’t run as wanted. Is this how it is suppose to be or I just don’t know the other way of doing it.

Thanks in advance for people replying ^_^

$squared = pow(3,2);

echo "\"3 squared is $squared:";
echo "br/";

$zero = -1;
while ($squared > $zero)
{
    $zero++;
    if ($zero == 5)
    {
        continue;
    }
    else if ($squared == $zero)
    {
        echo "$squared\"";
    }
    else
    {
        echo "$zero" . "br/";
    }
}
  • 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-17T13:39:27+00:00Added an answer on June 17, 2026 at 1:39 pm

    Here it is (you were almost there 😛 )

    $nr = 0;
    while ($squared > $nr) {
    
        if (5 == $nr) {
            $nr++; // add this
            continue;
        } else if ($squared == $nr) {
            echo "$squared\"";
        } else {
            echo "$nr" . "<br/>";
        }
        $nr++; // move to the bottom
    }
    

    PS: You’re welcome @clement

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

Sidebar

Related Questions

I have just started learning PHP and I want to create a website with
I have just started learning wordpress plugin development and got this error when I
I just started learning PHP and I have some questions about the parameters. Consider
I just started learning C but I don't understand this part of the code.
I have just started learning PHP, and here's my first doubt... Both of these
I have some php and javascript experience and just started learning curl. Been messing
I have just started learning coding and PHP so I have been looking at
I'm relatively new to PHP. Started learning PHP, but then come across cakePHP, which
I'm just learning PHP. I have a bunch of scripts I have started and
I just started learning PHP, and have been trying to build a website 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.