PHP code example of abdussalam / arabicdiffforhumans
1. Go to this page and download the library: Download abdussalam/arabicdiffforhumans library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
abdussalam / arabicdiffforhumans example snippets
use Abdussalam\ArDiffForHumans\ArabicDiffForHumans;
ArabicDiffForHumans::get($timestamp);
// Current date 2021-06-18 10:09pm
$time = "2018-1-1";
$timeStamp = strtotime($time);
echo ArabicDiffForHumans::get($timeStamp);
// منذ 3 سنين
use Abdussalam\ArDiffForHumans\ArabicDiffForHumans;
ArabicDiffForHumans::getFromDateString($dateString);
// Current date 2021-06-18 10:09pm
$time = "2018-1-1";
echo ArabicDiffForHumans::getFromDateString($time);
// منذ 3 سنين