Пример #1
0
    $time_start = microtime(true);

    date_default_timezone_set('UTC');
    $time = time();

    echo date('l dS F Y h:i:s A', $time);
    echo '<br /><br />';

    include('../Arabic.php');
    $Arabic = new Arabic('ArDate');

    $correction = $Arabic->dateCorrection ($time);
    echo $Arabic->date('l dS F Y h:i:s A', $time, $correction);
    echo '<br /><br />';

    $Arabic->setMode(2);
    echo $Arabic->date('l dS F Y h:i:s A', $time);
    echo '<br /><br />';
    
    $Arabic->setMode(3);
    echo $Arabic->date('l dS F Y h:i:s A', $time);
    echo '<br /><br />';

    $Arabic->setMode(4);
    echo $Arabic->date('l dS F Y h:i:s A', $time);
    echo '<br /><br />';

    $Arabic->setMode(5);
    echo $Arabic->date('l dS F Y h:i:s A', $time);
    echo '<br /><br />';
Пример #2
0
    $dbname = 'test';
    
    try {
        $dbh = new PDO('mysql:host=localhost;dbname='.$dbname, $dbuser, $dbpwd);

        // Set the error reporting attribute
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        $dbh->exec("SET NAMES 'utf8'");
    
        if ($_GET['keyword'] != '') {
            $keyword = @$_GET['keyword'];
            $keyword = str_replace('\"', '"', $keyword);
    
            $Arabic->setStrFields('headline');
            $Arabic->setMode($_GET['mode']);
    
            $strCondition = $Arabic->getWhereCondition($keyword);
            $strOrderBy = $Arabic->getOrderBy($keyword);
        } else {
            $strCondition = '1';
        }
    
        $StrSQL = "SELECT `headline` FROM `aljazeera` WHERE $strCondition ORDER BY $strOrderBy";

        $i = 0;
        foreach ($dbh->query($StrSQL) as $row) {
            $headline = $row['headline'];
            $i++;
            if ($i % 2 == 0) {
                $bg = "#f0f0f0";