Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


what method is used to generate a random number?

Answers were Sorted based on User's Feedback



what method is used to generate a random number?..

Answer / lakhan lal

use rand() or mt_rand()

example:rand() or rand(20,30);

Is This Answer Correct ?    7 Yes 1 No

what method is used to generate a random number?..

Answer / mahidhar

using rand() function we generate the random numbers.

example : $num="12345678";
$result=rand($num);

the $result gives the random numbers.

Is This Answer Correct ?    7 Yes 4 No

what method is used to generate a random number?..

Answer / senthilkumar g

using srand();
it will generate the randam numbers

Is This Answer Correct ?    3 Yes 0 No

what method is used to generate a random number?..

Answer / sunil kumar

<?php
echo(4,900);//depend upon ur choice
?>

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More PHP Interview Questions

What does echo mean in php?

0 Answers  


What are the different functions in sorting an array?

2 Answers  


AentteQ Software Technologies Q: what are benifits of using LAMP..?

5 Answers  


How can I prevent sql-injection in php?

0 Answers  


How to return ascii value of character in php?

0 Answers  






How to check your php installation?

0 Answers  


Can we override static method in php?

0 Answers  


Is set in php?

0 Answers  


What is the w3c?

0 Answers  


Is string php function?

0 Answers  


How can we automatically escape incoming data?

0 Answers  


<?php include ("db.php"); $result = mysql_query("SELECT ques_id FROM questionbank order by ques_id limit 5 "); while($obj=mysql_fetch_array($result)) { $ad1[$obj['ques_id']]++;//Used an array and inserted the database query results into it. } $rand_keys=array_rand($ad1,1); //Did a random array function echo "First random id = ".$ad1[$rand_keys[0]]; echo "<br>Second random id = ".$ad1[$rand_keys[1]]; ?> <!--Its not working. Have any solution for this. -->

1 Answers  






Categories