PHP Classes

File: myDate.php

Recommend this page to a friend!
  Classes of almubarmij   MyTemplate Class   myDate.php   Download  
File: myDate.php
Role: Example script
Content type: text/plain
Description: Hijry date php script
Class: MyTemplate Class
Template engine using eval to replace variables
Author: By
Last change:
Date: 18 years ago
Size: 1,539 bytes
 

Contents

Class file image Download

<?php

###########################################################
// &#1605;&#1604;&#1601; &#1575;&#1604;&#1602;&#1575;&#1604;&#1576;
include("inc/MyTemplate.class");

// &#1578;&#1575;&#1585;&#1610;&#1582; &#1575;&#1604;&#1610;&#1608;&#1605; &#1576;&#1575;&#1604;&#1607;&#1580;&#1585;&#1610;&#1577;:
$hijri = MyTemplate::arabicDate('hj:d/m/Y', time());

// &#1578;&#1575;&#1585;&#1610;&#1582; &#1575;&#1604;&#1610;&#1608;&#1605; &#1576;&#1575;&#1604;&#1607;&#1580;&#1585;&#1610;&#1577; - &#1603;&#1575;&#1605;&#1604;&#1575;&#1611;:
$hijri_full = MyTemplate::arabicDate('hj:l, d/F/Y', time());

// &#1575;&#1604;&#1578;&#1581;&#1608;&#1610;&#1604; &#1605;&#1606; &#1578;&#1575;&#1585;&#1610;&#1582; &#1605;&#1610;&#1604;&#1575;&#1583;&#1610; &#1573;&#1604;&#1609; &#1607;&#1580;&#1585;&#1610;:
$geoDate = '07/07/1978';
$geoDatex = explode('/', $geoDate);
$conversion_result = MyTemplate::arabicDate('hj:d/m/Y', strtotime($geoDatex[1].'/'.$geoDatex[0].'/'.$geoDatex[2]));

// &#1578;&#1575;&#1585;&#1610;&#1582; &#1575;&#1604;&#1610;&#1608;&#1605; &#1575;&#1604;&#1605;&#1610;&#1604;&#1575;&#1583;&#1610; &#1576;&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;:
$gdate = MyTemplate::arabicDate('ar:l, d/F/Y', time());


// &#1575;&#1587;&#1578;&#1583;&#1593;&#1575;&#1569; &#1602;&#1575;&#1604;&#1576; &#1575;&#1604;&#1589;&#1601;&#1581;&#1577;
$html = MyTemplate::MyTemplate("templates/myDate.html");
eval (
"print stripslashes(\"$html\");");

###########################################################

?>