This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you use your own (U)(G)UID generator for unique identifiers, say UserGUID or WidgetGUID or whatnot, there is very little chance you are ever going to need to use something like `md5(time())` or `bin2hex(random_bytes(5))` or whatever. | |
Using just a very basic (and all lowercase) `a-z` & `0-9` combination will result in a 36 character string. | |
abcdefghijklmnopqrstuvwxyz0123456789 = 36 characters | |
If we take those 36 characters to the `power of` we get the follow possible unique vales: | |
[1] = 36 | |
[2] = 1,296 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !(register|contact|signin|policies) [NC] | |
RewriteCond %{REQUEST_URI} !=/favicon.ico | |
RewriteRule ^(.*)$ /profile.php?id=$1 [L,QSA] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$word = 'dddddd'; | |
if (empty(str_replace(mb_substr(trim($word),-1),'',trim($word)))) { | |
die('all the characters are identical'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Today = gregoriantojd(date('n'),date('j'),date('Y')); | |
$Month = jdmonthname($Today,4); | |
$Date = jdtojewish($Today); | |
list($notused, $Day, $Year) = explode('/',$Date); | |
echo "$Month $Day, $Year"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// | |
/////////////////////////////////////////////////////////////////////// | |
// bitly_MakeShortLink() | |
// | |
// - Description: | |
// Use the bit.ly api to generate short URL | |
// | |
// - Usage: | |
// $ShortURL = bitly_MakeShortLink($url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// | |
/////////////////////////////////////////////////////////////////////// | |
// intToOrdinal() | |
// | |
// - Description: | |
// Add Ordinal Text To Integer | |
// | |
// - Usage: | |
// $str_return = intToOrdinal($number); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// | |
/////////////////////////////////////////////////////////////////////// | |
// howManyDaysBetweenTwoDays() | |
// | |
// - Description: | |
// How many days between two unix time stamps | |
// 86400 is derived from: | |
// 60 (seconds) multiplied by 60 (minutes) multiplied by 24 (hours) | |
// |
NewerOlder