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
$start = new DateTime('now'); | |
$end = new DateTime('- 7 day'); | |
$diff = $end->diff($start); | |
$interval = DateInterval::createFromDateString('-1 day'); | |
$period = new DatePeriod($start, $interval, $diff->days); | |
foreach ($period as $date) { | |
echo $date->format('m-d') . '<br>'; // or whatever you want to do | |
} |
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
// | |
// | |
/////////////////////////////////////////////////////////////////////// | |
// 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
// | |
// | |
/////////////////////////////////////////////////////////////////////// | |
// 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