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
<?php | |
function time2str($ts) { | |
if(!ctype_digit($ts)) { | |
$ts = strtotime($ts); | |
} | |
$diff = time() - $ts; | |
if($diff == 0) { | |
return 'now'; | |
} elseif($diff > 0) { | |
$day_diff = floor($diff / 86400); |
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
<?php | |
function br2nl($string) { | |
return preg_replace('=<br */?>=i', "\n", $string); | |
} | |
?> |
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
<?php | |
function get_1900_date($date) { | |
$start = strtotime("1900-01-01"); | |
$diff = $date - $start; | |
$days = $diff / 86400; | |
return round($days, 0); | |
} | |
?> |