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

What is meant by ‘passing the variable by value and reference' in php?

534


Explain me what is the use of header() function in php?

623


What is php dependency injection?

529


Tell me what is mean by an associative array?

525


What is $_ get?

534






What is api used for?

489


How is it possible to know the number of rows returned in result set?

531


Explain what is the difference between $var and $$var?

530


What do you mean range() in php?

603


How to block direct directory access in PHP?

563


How do you find the length of a string in php?

518


Which is used to maintain the value of a variable over different pages?

573


What is compact function php?

539


How error handling is being handled by php?

550


How to get a random value from a php array?

553