Skip to content

Instantly share code, notes, and snippets.

@tobiasroeder
Created October 18, 2021 14:02
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 tobiasroeder/20d60f4292e673bd46436b04e8592b9c to your computer and use it in GitHub Desktop.
Save tobiasroeder/20d60f4292e673bd46436b04e8592b9c to your computer and use it in GitHub Desktop.
0-9 A-Z a-z
<?php
$chars = '';
// 65 - 122 (A-Za-z)
// 48 - 122 (0-9A-Za-z)
for ($i = 48; $i <= 122; $i++) {
// skip 58 - 64 and 91 - 96
if ($i >= 58 && $i <= 64 || $i >= 91 && $i <= 96)
continue;
$chars .= chr($i);
}
var_dump($chars);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment