PHP code example of ameen-sarsour / ar-php

1. Go to this page and download the library: Download ameen-sarsour/ar-php 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/ */

    

ameen-sarsour / ar-php example snippets


return [
    //....
    'components' => [
     'strToTime'=>[
               'class' => \ArPhp\Arabic::class,
               'library' => '{{name of library eg. strToTime}}'
           ],
    ],
];

        $str  = '1 رمضان 1439';
        $int  = \Yii::$app->strToTime->strtotime($str, $time);
        $date = date('l dS F Y', $int);
        echo "String: $str \n";
        echo "TimeStamp: $int \n";
        echo "Date: $date \n";
        echo $message . "\n";

composer 
include ('vendor/autoload.php');

use \ArPhp\Arabic;

$time = time();
$Arabic = new Arabic('StrToTime');

$str  = '1 رمضان 1439';
$int  = $Arabic->strtotime($str, $time);
$date = date('l dS F Y', $int);
echo "String: $str \n";
echo "TimeStamp: $int \n";
echo "Date: $date \n";