Display odd even number without submit button PHP

Asked By 70 points N/A Posted on -
qa-featured

How to display odd even number without using submit button using PHP?

It is possible?

 

SHARE
Answered By 0 points N/A #104393

Display odd even number without submit button PHP

qa-featured

Hi Rhon,

I didn't get exactly what you want to do. If you just want to display it in a form then take a look at this sample:

<?php

for($i = 0;$i<99;$i++)
{
$var = rand(1,100); // take random seed and decide whether it is odd of even
 
if($var % 2 == 0) // check if even
{
echo $var." is Evenn"; // simply display even number  in the browser
}
else  // must be odd
{
echo $var. " is Oddn"; // simply display odd number in the browser
}
}
?>
 
But if you want to do something else, you might want to take a look at this website for reference.
 
 
I hope it helped.

Login/Register to Answer

Related Questions