2017-06-03 13 views
-2

こんにちは、この質問はthisに関連していますが、これはイベントを.ics形式で保存します。私はリンクがクリックされたときにgoogleを開き、自動的に画面のようにそれを保存するようなものを考えているenter image description here。だから私はそれがGoogleカレンダーのページへイベントをGoogleカレンダーに保存する

答えて

0

私をリダイレクトするリンクをクリックした後、下の画像のようなその何かはこれを試してみてください:

<?php 
$url = 'https://www.google.com/calendar/render?action=TEMPLATE&text={{ text }}&dates={{ start }}/{{ end }}&details={{ details }}&location={{ location }}&sf=true&output=xml'; 

$event = [ 
    'text' => 'Your Event Name', 
    'start' => date('Ymd\THis\Z', strtotime('today')), 
    'end' => date('Ymd\THis\Z', strtotime('tomorrow')), 
    'details' => 'Click here for more details: http://example.com', 
    'location' => 'Waldorf Astoria, 301 Park Ave , New York, NY 10022' 
]; 

foreach ($event as $key => $value) { 
    $url = str_replace("{{ $key }}", urlencode($value), $url); 
} 

echo $url; 

あなたが生成されたURLに移動すると、ページは上のようになります。スクリーンショット。

関連する問題