Skip to content

Instantly share code, notes, and snippets.

@iforwms
Last active August 29, 2015 14:12
Show Gist options
  • Save iforwms/bce6d3b07d00a6968795 to your computer and use it in GitHub Desktop.
Save iforwms/bce6d3b07d00a6968795 to your computer and use it in GitHub Desktop.
PHP: Create Secret Token
// CREATE SECRET TOKEN
function generate_secure_token($length = 16)
{
return bin2hex(openssl_random_pseudo_bytes($length));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment