【问题标题】:How to don't view a ?channel如何不查看?频道
【发布时间】:2017-03-07 23:02:48
【问题描述】:

如果我在 ?user= 上,如何不在我的网站上查看 ?channel=

代码:

https://hastebin.com/xetanogeta.xml

【问题讨论】:

  • 你可以使用post方法...或者在url中使用encode和decode

标签: php youtube-api


【解决方案1】:

这应该会有所帮助。
我在我的网站上使用它来选择我需要拨打的电话类型。

$user = $_GET['user'];  
$youtube = $user;
$test_UCLA = $user;

strlen($user);
$user = substr($user, 0, 2);

if(($user == 'UC')&&($test_UCLA !== 'UCLA')){
    $data = file_get_contents('https://www.googleapis.com/youtube/v3/channels?&id='.$youtube.'&key='. $API_KEY);
}else{
    $data = file_get_contents('https://www.googleapis.com/youtube/v3/channels?&forUsername='.$youtube.'&key='. $API_KEY);   
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-25
    • 2022-01-05
    • 2011-11-23
    • 2017-09-24
    • 2022-11-16
    • 2021-12-31
    • 2020-12-01
    • 2019-03-18
    相关资源
    最近更新 更多