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

Answer Posted / shankar

<?php
$n=10;//number_of_numbers_required_to_display

for($i=0;$i<$n;$i++){
$num=rand(1,100);
echo $num;?>
<br/>
<?php
}
?>

Is This Answer Correct ?    9 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to call a php function from another php file?

582


What language is php based on?

569


What is cookie in php with example?

598


What is php and its uses?

587


What is difference between require_once(), require(), include()?

604






What is an anti csrf token?

585


Who is the father of php and what is the current version of php and mysql?

771


How can I display text with a php script?

563


How to replace a substring in a given string in php?

617


Php says that an array is an ordered map. But how the values are ordered in an array?

684


Explain me the difference between include and require?

594


Which function can be used to delete a file?

691


Write down the code for saving an uploaded file in PHP.

683


What are computer variables?

615


What is the difference between null and empty?

660