n w    w w w w

baner

Knowledge is power, and what about sharing the power. CodeGlobe is an open space where we programmers and techies share what we got special with us, The experience we got over years through our profession, the magical touch we made in solving logical hurdles, the new solutions we developed ourselves where others hesitated, alike all these, each and every bit of knowledge we got, let's just share with our pals. All we have to posses is just a mind to speak out and listen others. Registrations are open and hope you won't fail in grabbing this opportunity to become a Codeglober.


 


 

You are here:   Home / Web Development / PHP
large small default
PHP
Random Number Generation in PHP Print E-mail
Written by Nimish T   
Thursday, 14 July 2011 09:26

 

Random Number Generation in PHP

function randomdigit($digits) { 
static $startseed = 0; 
if (!$startseed) {
$startseed = (double)microtime()*getrandmax(); 
srand($startseed);
}
$range = 8;
$start = 1;
$i = 1;
while ($i<$digits) {
$range = $range . 9;
$start = $start . 0;
$i++;
}
return (rand()%$range+$start); 
}
?>

 
Creating array of HTML form elements Print E-mail
Written by Musthafa   
Thursday, 14 July 2011 09:23

Array is a collection of similar data elements, means we can use array to store similar elements referenced under a common name.

In web development sometimes we need to group HTML form elements as arrays do. For example, you have a form where user has to select his hobbies from a group of check boxes as given below.









 

Last Updated on Thursday, 14 July 2011 09:42
Read more...