Write a php code which could be used to generate random
numbers between 1 - 100 and display them on the screen.

Answer Posted / ashok

<?php
$n=10;//number_of_numbers_required_to_display
$num=rand(1,100);
for($i=0;$i<$n;$i++)
{
echo rand(1,100)."<BR>";
}
?>

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cms php?

581


What is different between software and app

1308


How to open a file for reading?

633


Which functions are used to count the total number of array elements in php?

620


What is the difference between Split and Explode in PHP?

654






What is framework in php?

591


Tell me what does the array operator '===' means?

602


What is use of htmlspecialchars php?

603


What is a php 5?

629


Tell me is it possible to protect special characters in a query string?

569


Code to open file download dialog in PHP?

631


What is the difference between the include() and require() functions?

999


Explain me what is x+ mode in fopen() used for?

639


What is sql injection in php?

628


Does php support multiple inheritance?

578