Arabic
[ class tree: Arabic ] [ index: Arabic ] [ all elements ]

Procedural File: ArStrToTime.class.php

Source Location: /sub/ArStrToTime.class.php



Classes:

ArStrToTime
This PHP class parse about any Arabic textual datetime description into a Unix timestamp


Page Details:

----------------------------------------------------------------------

Copyright (C) 2009 by Khaled Al-Shamaa.

http://www.ar-php.org

----------------------------------------------------------------------

LICENSE

This program is open source product; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>.

----------------------------------------------------------------------

Class Name: Arabic StrToTime Class

Filename: ArStrToTime.class.php

Original Author(s): Khaled Al-Sham'aa <khaled.alshamaa@gmail.com>

Purpose: Parse about any Arabic textual datetime description into a Unix timestamp

----------------------------------------------------------------------

Arabic StrToTime Class

PHP class to parse about any Arabic textual datetime description into a Unix timestamp.

The function expects to be given a string containing an Arabic date format and will try to parse that format into a Unix timestamp (the number of seconds since January

  1. 1970 00:00:00 GMT), relative to the timestamp given in now, or the current
time if none is supplied.

Example:

  1.      date_default_timezone_set('UTC');
  2.      $time time();
  3.  
  4.      echo date('l dS F Y'$time);
  5.      echo '<br /><br />';
  6.  
  7.      include('./Arabic.php');
  8.      $Arabic new Arabic('ArStrToTime');
  9.  
  10.      $int  $Arabic->strtotime($str$time);
  11.      $date date('l dS F Y'$int);
  12.      echo "<b><font color=#FFFF00>Arabic String:</font></b> $str<br />";
  13.      echo "<b><font color=#FFFF00>Unix Timestamp:</font></b> $int<br />";
  14.      echo "<b><font color=#FFFF00>Formated Date:</font></b> $date<br />";




Tags:

author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
copyright:  2009 Khaled Al-Shamaa
link:  http://www.ar-php.org
license:  LGPL








Documentation generated on Tue, 18 Aug 2009 00:12:51 +0300 by phpDocumentor 1.4.0