You are here

function advagg_test_randon_string in Advanced CSS/JS Aggregation 7.2

Generates random string.

Parameters

int $length: How many characters will this string contain.

array $pool: Array of characters to use.

Return value

string Random string.

Related topics

1 call to advagg_test_randon_string()
advagg_test_generate_selector_css in tests/advagg.test
Generates a large CSS string.

File

tests/advagg.test, line 73
Tests for advagg.module.

Code

function advagg_test_randon_string($length, array $pool) {
  $string = '';
  $count = count($pool);
  for ($i = 0; $i < $length; $i++) {
    $string .= $pool[mt_rand(0, $count - 1)];
  }
  return $string;
}