Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

mt srand function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php mt srand () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 3>= 3.0.6, PHP 4 , PHP 5)

mt_srand -- Seed the better random number generator

Syntax

void mt_srand ( [int seed] )

Seeds the random number generator with seed. Since PHP 4.2.0, the seed becomes optional and defaults to a random value if omitted.

Example 1. mt_srand() example

<?php
// seed with microseconds
function make_seed()
{
    list(
$usec, $sec) = explode(' ', microtime());
    return (float)
$sec + ((float) $usec * 100000);
}
mt_srand(make_seed());
$randval = mt_rand();
?>

Note: As of PHP 4.2.0, there is no need to seed the random number generator with srand() or mt_srand() as this is now done automatically.

See also: mt_rand(), mt_getrandmax(), and srand().

Php mt srand Function syntax tag

mt srand php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php mt srand syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online