0

YouTube PHP APIを使用して、「スーパーボウルコマーシャル」という正確な用語を検索するフィードを取得しています。

ただし、フィードに無関係な動画が含まれることがあります。

$ searchTermsは、検索クエリを格納します。

$searchTerms2 = str_replace(" ","+",$searchTerms);
$searchTerms2 = '"' . $searchTerms2 . '"';

$query->setVideoQuery($searchTerms2);

この問題の解決策を知っている人はいますか?

4

1 に答える 1

1

参照から: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あなたの引用符ですか?

于 2013-01-16T18:08:26.373 に答える