answersLogoWhite

0


Best Answer

Example:

<?php

$value = 10;

$i = 0

if(is_int($value))

{

while($i < $value)

{

echo $i;

echo '<br/>';

$i++;

}

}

?>

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you increment a number using while in php?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does the increment operator do in PHP?

The incremental operator increases the variable by 1. See the example below: &lt;?php $number = 10; $number++; echo $number; // outputs 11 ?&gt;


How do you retrieve auto increment id in PHP and MySQL?

When creating the MySQL database select "Auto-Increment" on the "Extras" bar.


What is php plus plus?

PHP++ is an object-oriented version of the PHP programming language. ++ is used in programming to increment a variable by one so it means an improved version of PHP.


How do you count the number of elements in an array using PHP?

Using the function "count". &lt;?php $foo = array("John", "Jacob", "Jingleheimer", "Schmidt"); echo count($foo); // &lt;-- outputs the number 4 ?&gt;


How i can begin php in Linux?

PHP on windows runs using the WAMP Server while on Linux it runs using the LAMP Server. Try getting a LAMP Server from a search engine


Does android supports PHP?

It supports websites made on php but not coding in php. There are workarounds for coding in PHP using Android.


Is Answers.com coded using PHP or ASP?

If you're referring to Answers.com, it's built using PHP as a backend.


How do you add a comment in PHP?

&lt; ?php // This is an example of comment in PHP /* This is another example of comment in PHP and we can write comments in multiple lines using this method */ ? &gt;


Why do we use Php?

PHP is an Open Source Scripting Language. We can create Web Pages and Web Applications using PHP.


How to display a variable in PHP using echo or print statements?

displaying a variable in php using echo statement? &lt;?php $name="ram"; //declaring and defining the variable echo "$name"; //printing the variable using echo command ?&gt;


How do you create a loop using PHP?

There are a number of different ways to loop using PHP. They're as follows:ForForeachWhileDo-whileBelow are some examples of how each of these types of loop work.ForForeachWhileDo-while


What is the correct way to add 1 to the count variable in php?

There are several ways to increment a variable:$count = $count +1;$count += 1;$count++;++$count;