note 109019 deleted from function.time by sobak
| From: | sobak@php.net | Date: | Thu, 01 Dec 2016 13:55:04 +0000 |
| Subject: | note 109019 deleted from function.time by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207860@lists.php.net to get a copy of this message | ||
Note Submitter: xzxxxx7 at gmail dot com
----
hebrew time Ago function by xzxxx7
<?php
function he_timeAgo( $a ){
$b = time() - $a;
$c = array( 12 * 30 * 24 * 60 * 60, 30 * 24 * 60 * 60, 7 * 24 * 60 * 60, 24 * 60 * 60, 60 * 60, 60
);
$d = array( "×©× ×", "×××ש", "ש×××¢",
"×××", "שע×", "××§×" );
$e = array( "×©× ××", "×××ש××",
"ש×××¢×ת", "××××", "שע×ת",
"××§×ת" );
if( $b < 60 ) return "פ××ת ×××§×";
for( $f=0; ( $h = $b/$c[$f] ) <= 1 && $f < 5; $f++);
return ( floor($h) > 1 ) ? sprintf( "%d %s", $h, $e[$f] ) : $d[$f];
}
?>
<!doctype html>
<html lang="he_IL" dir="rtl">
<head>
<title>[PHP] he_timeAgo function</title>
<meta charset="utf-8">
<meta name="author" content="xzxxx7">
</head>
<body>
פ××¨×¡× ××¤× × <?php echo he_timeAgo(1111111111);?>
</body>
</html>