Skip to content

Instantly share code, notes, and snippets.

@ericstone57
Last active October 26, 2020 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericstone57/699e7fd6a80268a753ca48ae32eeaef6 to your computer and use it in GitHub Desktop.
Save ericstone57/699e7fd6a80268a753ca48ae32eeaef6 to your computer and use it in GitHub Desktop.
PHP simple random code generator
<?php
// code length 5 characters
$code = substr(str_shuffle('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 1, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment