0
如何在youtube api中通過php中的標題進行排序?在search.list的文檔中,它表示訂單是一個可選參數。如何按照標題或日期排列我打印的內容? 嘗試{按標題搜索的順序youtube api
// Call the search.list method to retrieve results matching the specified
// query term.
$searchResponse = $youtube->search->listSearch('id,snippet', array(
'q' => $_GET['q'],
'maxResults' => $_GET['maxResults'],
));
$videos = '';
$channels = '';
$playlists = '';
// Add each result to the appropriate list, and then display the lists of
// matching videos, channels, and playlists.
foreach ($searchResponse['items'] as $searchResult) {
switch ($searchResult['id']['snippet']) {
case 'youtube#video':
$videos .= sprintf('<li>title=%s link = http://youtube.com/watch?v=%s/ channelid = %s</li><br> ',
$searchResult['snippet']['title'], $searchResult['id']['videoId'], $searchResult['snippet']['channelTitle']);
break;
感謝!我得到它的工作 –
太棒了!我很高興聽到這個消息。 –
每當我做'訂單'=>'viewCount'它不會返回任何東西 –