Генератор на случайни думи php

Примерен код

22
0

NU

Random rnd = new Random();
int month  = rnd.Next(1, 13);  // creates a number between 1 and 12
int dice   = rnd.Next(1, 7);   // creates a number between 1 and 6
int card   = rnd.Next(52);     // creates a number between 0 and 51
21
0

Генератор на случайни реда PHP

function generateRandomString($length = 25) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}
//usage 
$myRandomString = generateRandomString(5);
11
0

генератор на случайни цветове javascript

function generateRandomColor() {
  var letters = '0123456789ABCDEF';
  var color = '#';
  for (var i = 0; i < 6; i++) {
    color += letters[Math.floor(Math.random() * 16)];
  }
  return color;
}

var randomColor=generateRandomColor();//"#F10531"
1
0

случайна дума с използване на списъка с думи php

// Read the whole file into a array.
$file = file('File Location');

// Getting the Words Count in the file.
$wCount = count($file);

// Printing out the random word.
echo $file[rand(0, $wCount - 1)];

// This is a one liner.
echo file('File Location')[rand(0, count(file('File Location')) - 1)];
-1
0

Генерирайте случайна ред в PHP

phpCopy<?php
function random_str_generator ($len_of_gen_str){
    $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    $var_size = strlen($chars);
    echo "Random string ="; 
    for( $x = 0; $x < $len_of_gen_str; $x++ ) {  
        $random_str= $chars[ rand( 0, $var_size - 1 ) ];  
        echo $random_str;  
    }
echo "\n";
}
random_str_generator (8)
?>

Подобни страници

Подобни страници с примери

На други езици

Тази страница на други езици

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Íslensk
..................................................................................................................