Rapide Advanced Adulte
 
 Web|Image|Shop|Video|News|Wmx|Mobile|Wiki|Ajouter ce moteur

     Manuel PHP     
Partager
 
 
Partager
Partager

 

Table :

.abs
.acos
.acosh
.asin
.asinh
.atan2
.atan
.atanh
.base convert
.bindec
.ceil
.cos
.cosh
.decbin
.dechex
.decoct
.deg2rad
.exp
.expm1
.floor
.fmod
.getrandmax
.hexdec
.hypot
.is finite
.is infinite
.is nan
.lcg value
.log10
.log1p
.log
.max
.min
.mt getrandmax
.mt rand
.mt srand
.octdec
.pi
.pow
.rad2deg
.rand
.round
.sin
.sinh
.sqrt
.srand
.tan
.tanh
 
   

  srand  


srand

(PHP 3, PHP 4, PHP 5)

srand -- Initialise le générateur de nombres aléatoires

Description

void srand ( [int seed] )

srand() initialise le générateur de nombres aléatoires avec seed. Depuis PHP 4.2.0, le paramètre seed est devenu optionnel et est généré par PHP s'il n'est pas renseigné.

Exemple 1. Exemple avec srand()

<?php
// initialise avec les microsecondes
function make_seed()
{
    list(
$usec, $sec) = explode(' ', microtime());
    return (float)
$sec + ((float) $usec * 100000);
}
srand(make_seed());
$randval = rand();
?>

Note : Depuis PHP 4.2.0, vous n'avez plus besoin d'initialiser le générateur de nombres aléatoires avec srand() ou mt_srand() car c'est fait automatiquement.

Voir aussi rand(), getrandmax() et mt_srand().


    Annonces       
 

 Retour au chapitre Php

 

Top
 

Ajouter JungleKey.fr à votre Explorateur

 
 

About Us | © 2007 JungleKey




iBlack | Mobile | Wiki | Ajouter ce moteur
.