Let's say i have this function but i don't know how to call it...
echo getYoutubeSearchVideosFeeds($variables);
with what i should replace $variables to call $q, $orderby, $startIndex and so on?
function getYoutubeSearchVideosFeeds($criteria) {
$url = 'http://gdata.youtube.com/feeds/api/videos?';
$q = urlencode($criteria['q']);
$orderby = $criteria['orderby']; // relevance, published, viewCount, rating
$startIndex = $criteria['start-index'];
$maxResults = $criteria['max-results'];
$author = $criteria['author'];
$format = $criteria['format'];
$lr = $criteria['lr']; // fr, en
$safeSearch = $criteria['safeSearch']; //none, moderate, strict
// more code
}
Just pass it an associative array with the values listed in the function:
getYoutubeSearchVideosFeeds(array('q' => '...', 'orderby' => '...', ...));
Pass an array populated with values for each of the keys the function requires:
getYoutubeSearchVideosFeeds(array('q' => '...', 'orderby' => '...'));
getYoutubeSearchVideosFeeds(
array(
"q"=>"CriteriaValuesHere..GetItFromGDataHelp",
"start-index" => "Other Values"
.
.
.
)
);