PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Khaled Al-Shamaa   ArDate   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ArDate
Format times and dates in Arabic
Author: By
Last change:
Date: 18 years ago
Size: 1,823 bytes
 

Contents

Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html;charset=windows-1256" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<title>Arabic/Islamic Date and Calendar</title>
</head>

<body>

<center>
<div style="width: 80%; position:absolute; left:10%; top:0%; z-index:1">
<br />
<div class="tabArea" align="center">
  <a class="tab" href="example.php">Example</a>
  <a class="tab" href="about.html">About</a>
</div>

<div class="Paragraph">

<?php
echo '<br /><h2>Example Code</h2>';

highlight_string("<?php
\$time = time();

echo '<p dir=\"ltr\">';
echo date('l dS F Y h:i:s A', \$time);
echo '</p>';

include('ArDate.class.php');
\$x = new ArDate(1);

echo '<p dir=\"rtl\">';
echo \$x->date('l dS F Y h:i:s A', \$time);
echo '<br /><br />';

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

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

\$x->setMode(4);
echo \$x->date('l dS F Y h:i:s A', \$time);
echo '</p>';
?>"
);

echo
'<br /><br /><h2>Example Output</h2>';

$time = time();

echo
'<p dir="ltr">';
echo
date('l dS F Y h:i:s A', $time);
echo
'</p>';

include(
'ArDate.class.php');
$x = new ArDate(1);

echo
'<p dir="rtl">';
echo
$x->date('l dS F Y h:i:s A', $time);
echo
'<br /><br />';

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

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

$x->setMode(4);
echo
$x->date('l dS F Y h:i:s A', $time);
echo
'</p>';
?>
</div>
<br />
</div>
</center>
</body>
</html>