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

Which is better php or wordpress?

523


How do I escape data before storing it into the database?

536


Which PHP function would you use to send an email?

604


What is overriding in php?

613


How to calculate the difference between two dates using php?

548






Does csrf token change?

525


Which programming language does php resemble to?

551


What is escape data in php?

527


Differences between get, post and request methods ?

499


Can I run php without xampp?

505


What is polymorphism?

2071


Which is the dependent variable?

495


What are the features of php 7?

508


What are the advantages of triggers in php?

479


What is a php certification?

497