本文整理汇总了PHP中Arrays::getArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Arrays::getArray方法的具体用法?PHP Arrays::getArray怎么用?PHP Arrays::getArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arrays
的用法示例。
在下文中一共展示了Arrays::getArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: splitArrayCategory
function splitArrayCategory($stat, $sep, $page)
{
$array = Arrays::getArray($stat);
$phrase = Phrases::getPhrase($stat);
$inserts = null;
for ($i = 0; $i < count($array); $i++) {
if ($i > 0) {
$inserts .= $sep;
}
if ($stat == "achievement") {
$img = "<img src='images/achievements/" . $array[$i] . ".png' class='img'> ";
} else {
if ($stat == "stat.killEntity" || $stat == "stat.entityKilledBy") {
$img = "<img src='images/mobs/" . $array[$i] . ".png' class='img'> ";
} else {
if ($stat != "stat") {
$img = "<img src='images/items/" . $array[$i] . ".png' class='img'> ";
}
}
}
$link = "top.php?do={$stat}&page={$page}&sort=" . $array[$i];
$asc = " <a href='{$link}&order=ASC'><img src='images/up.png' class='sort'></a>";
$desc = " <a href='{$link}&order=DESC'><img src='images/down.png' class='sort'></a>";
$inserts .= $img . $phrase[$i] . $asc . $desc;
}
return $inserts;
}
示例2: splitArrayCategory
function splitArrayCategory($stat, $sep)
{
$array = Arrays::getArray($stat);
$phrase = Phrases::getPhrase($stat);
$inserts = null;
for ($i = 0; $i < count($array); $i++) {
if ($i > 0) {
$inserts .= $sep;
}
if ($stat == "achievement") {
$img = "<img src='images/achievements/" . $array[$i] . ".png' class='img'> ";
} else {
if ($stat == "stat.killEntity" || $stat == "stat.entityKilledBy") {
$img = "<img src='images/mobs/" . $array[$i] . ".png' class='img'> ";
} else {
if ($stat != "stat") {
$img = "<img src='images/items/" . $array[$i] . ".png' class='img'> ";
}
}
}
$inserts .= $img . $phrase[$i];
}
return $inserts;
}
示例3: getInsertArrayItem
private function getInsertArrayItem($stat)
{
$inserts = null;
$values = null;
$updates = null;
$total = 0;
foreach (Arrays::getArray($stat) as $value) {
if ($inserts != null) {
$inserts .= ", ";
$values .= ", ";
$updates .= ", ";
}
$inserts .= "`{$value}`";
$values .= "'" . $this->stats[$stat . '.minecraft.' . $value] . "'";
$updates .= "`{$value}`='" . $this->stats[$stat . '.minecraft.' . $value] . "'";
$total += $this->stats[$stat . '.minecraft.' . $value];
}
$inserts = "`total`, " . $inserts;
$values = "'{$total}', " . $values;
$updates = "`total`='{$total}', " . $updates;
return array($inserts, $values, $updates);
}
示例4: array_search
<?php
/*======================================================================*\
|| #################################################################### ||
|| # GawdScape Statistics Leaderboard # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2015 GawdScape. All Rights Reserved. # ||
|| #################################################################### ||
\*======================================================================*/
// #################### DEFINE IMPORTANT CONSTANTS #######################
$cat = $_GET['cat'];
$img = $_GET['img'];
// ######################### REQUIRE BACK-END ############################
require_once 'classes/Arrays.php';
require_once 'classes/Images.php';
require_once 'classes/Phrases.php';
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
if ($cat && $img) {
$index = array_search($img, Arrays::getArray($cat));
header("Location: " . Images::getUrl($cat, $index));
}