本文整理汇总了PHP中Movie::find_popular方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::find_popular方法的具体用法?PHP Movie::find_popular怎么用?PHP Movie::find_popular使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Movie
的用法示例。
在下文中一共展示了Movie::find_popular方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
require_once "../includes/initialize.php";
foreach ($LINK_CLASS_NAMES as $className) {
$popular_movies = Movie::find_popular($className);
$sql = "UPDATE popular SET link_count = {$linkCount} WHERE ";
$database->query($sql);
}
示例2: sendResponse
<?php
require_once "../includes/initialize.php";
// require key and id parameter.
if (empty($_GET['type']) || empty($_GET['key'])) {
sendResponse(400, "Invalid request. Please provide \"key\" and \"type\" parameters.");
} else {
if ($_GET['key'] != API_KEY) {
sendResponse(403, "Invalid API key.");
} else {
if (!empty($_GET['user_id'])) {
$movies = Movie::find_popular($_GET['type'], $_GET['user_id']);
} else {
$movies = Movie::find_popular($_GET['type']);
}
$results = array();
foreach ($movies as $movie) {
$results[] = $movie->export();
}
$popular = array("movies" => $results);
sendResponse(200, json_encode($popular));
}
}
示例3:
<?php
require_once "../includes/initialize.php";
$movies = Movie::find_popular("Itunes", 21);
foreach ($movies as $movie) {
print_r(json_encode($movie->export()));
echo "<br><br>";
}