PHP lottery game solved question

WAP to create a list of our closest family and friends and have a lottery. We will spin the wheel and randomly select one of our family and friends from the list

PHP functions used
Array()
count()
rand()
strtoupper()


<?php
$family=array();
                array_push($family,"Rahul");
                array_push($family,"Rahul1");
                array_push($family,"Rahul2");
                array_push($family,"Rahul3");
                array_push($family,"Rahul4");
                array_push($family,"Rahul5");
$count=count($family)-1;
$R=rand(0, $count);
Print strtoupper($family[$R]);
?>



If you know some other method feel free to share in comments. 
Share on Google Plus

About Rahul Rana

I am an experienced web designer and SEO expert. I am running my own online marketing company i.e "SEO To Web Design". Thanks for reading, keep sharing online marketing and web design knowledge.
    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment

Enter your email address:

Delivered by FeedBurner