base\Security generateRandomString()

generateRandomString() public method

Generates a random string of specified length.

The string generated matches [A-Za-z0-9_-]+ and is transparent to URL-encoding.

public string generateRandomString ( $length = 32 )
$length integer

The length of the key in characters

return string

The generated random key

throws yii\base\Exception

on failure.

doc_Yii
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.