Security\Random::base64

public base64 ([mixed $len])

Generates a random base64 string If $len is not specified, 16 is assumed. It may be larger in future. The length of the result string is usually greater of $len. Size formula: 4 *( $len / 3) and this need to be rounded up to a multiple of 4.

$random = new \Phalcon\Security\Random();

  echo $random->base64(12); // 3rcq39QzGK9fUqh8
doc_Phalcon
2016-10-16 09:56:30
Comments
Leave a Comment

Please login to continue.