我怎么知道我的访问令牌是否已过期.
我正在使用try和catch
try {
$result = file_get_contents('https://www.googleapis.com/calendar/v3/calendars/primary/events?access_token='.$accesstoken);
print_r($result);
}
catch(Exception $e){
echo "Get new token";
}
Run Code Online (Sandbox Code Playgroud)
但仍然从file_get_contents获取错误然后打印"获取新令牌"
如果我想使用卷曲
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'https://www.googleapis.com/calendar/v3/calendars/primary/events?access_token='.$accesstoken);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
Run Code Online (Sandbox Code Playgroud)
那么我该怎么做才能在这里发现错误?
//if error because access token is invalid,
do here
// my fixed solution
$response= json_decode($result);
if($response->error){ // if result has errors
echo "Get new token";
}
Run Code Online (Sandbox Code Playgroud) 如何从最新到最旧的顺序在Google日历中安排活动。我已经阅读了一些文档,但是,它似乎不起作用。
使用的参数:
orderby=created
orderby=updated
orderby=start
orderby=starttime
sortorder=ascending
Run Code Online (Sandbox Code Playgroud) 我想要达到这个效果:

我尝试了以下但它根本不起作用(根本没有边框).任何人都可以解释如何实现我想要的.
<style type="text/css">
.withBorder {
border: 1px;
}
.withoutBorder {
border: 0px;
}
</style>
<table>
<tr>
<td class = 'withoutBorder'> cell1 </td>
<td class = 'withBorder'> cell2 </td>
<td class = 'withoutBorder'> cell3 </td>
</tr>
<tr>
<td class = 'withBorder'> cell1 </td>
<td class = 'withoutBorder'> cell2 </td>
<td class = 'withBorder'> cell3 </td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud) 我想在检查checbox时禁用输入.
html的一部分:
<div class="span1 ">
<div class="control-group" id="niedziela">
<label class="control-label" for="">Niedziela</label>
<div class="controls">
<input type="text" value="<?= $metavalue->nightlife_open_7_start ?>" name="meta[nightlife_open_7_start]" id="nightlife_open_7_start" class="m-wrap span12 timepicker-24" placeholder="">
<input type="text" value="<?= $metavalue->nightlife_open_7_end ?>" name="meta[nightlife_open_7_end]" id="nightlife_open_7_end" class="m-wrap span12 timepicker-24" placeholder="">
<input id="klient_open_4_end" type="checkbox" <?=_ set_checked($metavalue->nightlife_open_7_end,'do ostatniego klienta') ?> value="do ostatniego klienta" name="meta[nightlife_open_7_end]" class="m-wrap span12 timepicker" placeholder=""> Do ost. klienta
<input id="zamkniete_open_4_end" type="checkbox" <?=_ set_checked($metavalue->nightlife_open_7_start,'zamkniete') ?> value="zamkniete" name="meta[nightlife_open_7_start]" class="m-wrap span12 timepicker" placeholder=""> Zamkni?te
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我想要的是,如果选中了id为klient_open_4_end的复选框,它应该禁用id ="nightlife_open_7_end"的输入
如果选中id ="zamkniete_open_4_end"的复选框,则应禁用两个输入文本区域
我尝试过:
<script type="text/javascript">
$(document).ready(function($) {
$('#klient_open_4_end').change(function() …Run Code Online (Sandbox Code Playgroud) access-token ×1
checkbox ×1
css ×1
curl ×1
google-api ×1
html ×1
html-table ×1
javascript ×1
jquery ×1
php ×1
sorting ×1