What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.

MCAL Functions

OverviewThe MCAL extension provides an interface to libmcal, a library which gives you a way of managing calendars, whether the data is stored locally or on a remote server. MCAL handles recurring events, alarms, and arbitrary metadata associated with each event. In addition, the library also provides a number of functions for working with dates.

MCAL was added to PHP 3 before PHP 3.0.13, and PHP 4 before 4.0b4. The set of functions described here assumes that you are using PHP 4 and libmcal 0.6 or later; in some cases you need later versions of libmcal, but those are noted in the function descriptions. If you use anything older, you will notice some discrepancies, as well as some compile problems.

The stream's global eventA number of MCAL functions manipulate the stream's global event in one way or another. All of the mcal_set_...() functions, mcal_append_event() , and mcal_store_event() are the most common examples. mcal_fetch_event() , as well as returning an event object, fetches that object into the stream's global event so that you can edit it.

The global event is a structure associated with each MCAL connection that keeps track of an event so that you do not need to pass the event as a parameter to every single function. It is unique to the MCAL connection, so if you have multiple connections open, they will have different global events.

If you need to know what is in the connection's global event, mcal_fetch_current_stream_event() will give you back an event object that describes it.

Datetime objectsA few MCAL functions return datetime objects, and event objects contain several of them. They may contain times, dates, or both. The date attributes are year, month, and mday. The time attributes are hour, min, and sec. You can access them using standard object notation.

$datetime; // A datetime object
if (isset($datetime->year)) {
   echo "Object has a date component: ";
   echo $datetime->year . "-";
   echo $datetime->month . "-";
   echo $datetime->mday . "<br>";
if (isset($datetime->hour)) {
   echo "Object has a time component: ";
   echo $datetime->hour . ":";
   echo $datetime->min . ":";
   echo $datetime->sec;

PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at The authors of this book have elected not to choose any options under the OPL. This online book was obtained from and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.