$Quotes = 0;
$pos = 0;
+ $j = strlen( $line );
- while ( $line <> '' ) {
+ while ( $pos < $j ) {
if ($line[$pos] == ' ') {
$pos ++;
} else if (strpos($line, '>', $pos) === $pos) {
if (($size < 1) || (strlen($chars) < 1)) {
return '';
}
-
+
sq_mt_randomize(); /* Initialize the random number generator */
-
+
$String = '';
+ $j = strlen( $chars ) - 1;
while (strlen($String) < $size) {
- $String .= $chars[mt_rand(0, strlen($chars))];
+ $String .= $chars{mt_rand(0, $j)};
}
-
+
return $String;
}