Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将outlook日历同步到您的日历_Php_Plugins_Calendar_Outlook_Sync - Fatal编程技术网

Php 将outlook日历同步到您的日历

Php 将outlook日历同步到您的日历,php,plugins,calendar,outlook,sync,Php,Plugins,Calendar,Outlook,Sync,你好 我正在使用我自己的日历应用程序进行工作或基本上进行编码,我想将我的outlook日历或sync我的outlook中的事件添加到我自己的日历中 这可能吗?如果是 有什么好的PHP插件可以用来做这类事情吗 如果否 你能解释一下原因吗?我能知道一些替代方案或更好的解决方案来解决我的问题吗 谢谢。您熟悉PHP COM对象吗?下面的内容将是理想的: <?php /** * This example uses COM() to Access Appointments * Requires

你好

我正在使用我自己的日历应用程序进行工作或基本上进行编码,我想将我的outlook日历或
sync
我的outlook中的事件添加到我自己的日历中

这可能吗?如果

有什么好的
PHP
插件可以用来做这类事情吗

如果

你能解释一下原因吗?我能知道一些替代方案或更好的解决方案来解决我的问题吗


谢谢。

您熟悉PHP COM对象吗?下面的内容将是理想的:

<?php

/**
 * This example uses COM() to Access Appointments
 * Requires Windows, Outlook
 *
 * @author justin DOT carlson AT gmail DOT com
 * @license none/free - sample code
**/

// define appointments array
$appointments = array();

// folder types (calendar, etc)
define('olFolderDeleted', 3);
define('olFolderOutbox', 4);
define('olFolderSent', 5);
define('olFolderInBox', 6);
define('olFolderCalendar', 9);
define('olFolderContacts', 10);
define('olFolderJournal', 11);
define('olFolderNotes', 12);
define('olFolderTasks', 13);
define('olFolderDrafts', 16);

// start instance
$outlook = new COM("Outlook.Application");
$namespace = $outlook->getNameSpace("MAPI");
$namespace->Logon();

// get calendar folder
$calendar = $namespace->GetDefaultFolder(olFolderCalendar);

// gather, sort, and configure entries
$entries = $calendar->Items;
$entries->Sort("[Start]");
$entries->IncludeRecurrences = True;

// search filter, change these YYYY/MM/DD values for your date range
$search = '[Start] >= "YYYY/MM/DD 12:00 am" AND [Start]<= "YYYY/MM/DD 11:59 pm"';

// find entries
$schedule = $entries->Find($search);

while ( ! is_null($schedule) ) {

    $appointment = array();
    $appointment['allday'] = $schedule->AllDayEvent;
    $appointment['subject'] = $schedule->Subject;
    $appointment['hours'] = ($schedule->Duration / 60);
    $appointment['location'] = $schedule->Location;
    $appointment['subject'] = $schedule->Subject;
    $appointment['body'] = $schedule->Body;
    $appointment['categories'] = $schedule->Categories;
    $appointment['start'] = date('m/d/Y h:i:s a', variant_date_to_timestamp($schedule->Start));
    $appointment['end'] = date('m/d/Y h:i:s a', variant_date_to_timestamp($schedule->End));
    $appointment['stamp'] = variant_date_to_timestamp($schedule->Start);
    $appointments[] = $appointment;
    $schedule = $entries->FindNext();

}

// $appointments now contains your entries, enjoy!
?>

tnx,谢谢您的回复。我要试试这个。