我正在使用YouTube PHP检索一个提要,该提要精确地搜索“超级碗商业广告”。
然而,我有时会在提要中收到不相关的视频。
$searchTerms存储搜索查询。
$searchTerms2 = str_replace(" ","+",$searchTerms);
$searchTerms2 = '"' . $searchTerms2 . '"';
$query->setVideoQuery($searchTerms2);有没有人知道这个问题的解决方案?
发布于 2013-01-17 02:08:26
参考资料:To search for an exact phrase, enclose the phrase in quotation marks. For example, to search for videos matching the phrase "spy plane", set the q parameter to %22spy+plane%22.
所以你urlencode你的引号?
https://stackoverflow.com/questions/14364626
复制相似问题