本文整理汇总了PHP中utility::getMaxOfArray方法的典型用法代码示例。如果您正苦于以下问题:PHP utility::getMaxOfArray方法的具体用法?PHP utility::getMaxOfArray怎么用?PHP utility::getMaxOfArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utility
的用法示例。
在下文中一共展示了utility::getMaxOfArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMaxOfArray
public static function getMaxOfArray($ArrayToCheck)
{
$maxValue = 0;
foreach ($ArrayToCheck as $temp) {
if (is_array($temp)) {
$maxValue = max($maxValue, utility::getMaxOfArray($temp));
} else {
$maxValue = max($maxValue, $temp);
}
}
return $maxValue;
}
示例2: extendedEncodeData
/**
* @brief Encodes the data as Extended Text.
*
* This specifies integer values from 0-4095, inclusive, encoded by two alphanumeric characters.
*
* @todo Add support for missing values
*/
private function extendedEncodeData($data)
{
$encode_string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.';
$max = utility::getMaxOfArray($data);
$encodedData = array();
if ($max > 4095) {
$rate = $max / 4095.0;
foreach ($data as $array) {
if (is_array($array)) {
$encodedData2 = array();
foreach ($array as $elem) {
$toEncode = (int) $elem / $rate;
$s = '';
for ($i = 0; $i < 2; ++$i) {
$m = $toEncode % 64;
$toEncode /= 64;
$s = $encode_string[$m] . $s;
}
array_push($encodedData2, $s);
}
array_push($encodedData, $encodedData2);
} else {
$toEncode = (int) $array / $rate;
$s = '';
for ($i = 0; $i < 2; ++$i) {
$m = $toEncode % 64;
$toEncode /= 64;
$s = $encode_string[$m] . $s;
}
array_push($encodedData, $s);
}
}
} else {
foreach ($data as $array) {
if (is_array($array)) {
$encodedData2 = array();
foreach ($array as $elem) {
$s = '';
$toEncode = $elem;
for ($i = 0; $i < 2; ++$i) {
$m = $toEncode % 64;
$toEncode /= 64;
$s = $encode_string[$m] . $s;
}
array_push($encodedData2, $s);
}
array_push($encodedData, $encodedData2);
} else {
$s = '';
$toEncode = $array;
for ($i = 0; $i < 2; ++$i) {
$m = $toEncode % 64;
$toEncode /= 64;
$s = $encode_string[$m] . $s;
}
array_push($encodedData, $s);
}
}
}
return $encodedData;
}
示例3: gBarChart
#unset($chartData['2011']);
#var_dump($chartData);
if (class_exists('gBarChart')) {
$Chart = new gBarChart(800, 350);
$max = 0;
$min = 99999;
$nummonths = 0;
$chartData = array_reverse($chartData, true);
foreach ($chartData as $year => $months) {
/*
print "<h3>$year</h3>";
var_dump($months);
*/
ksort($months);
$Chart->addDataSet(array_values($months));
$monthmax = $util->getMaxOfArray($months);
if ($monthmax > $max) {
$max = $monthmax;
}
$nummonths = count($months);
}
$Chart->setLegend(array_keys($chartData));
#$Chart->setBarWidth(4,1,3);
$Chart->setAutoBarWidth();
$Chart->setColors(array('ff3344', '11ff11', '22aacc', '3333aa'));
$Chart->setVisibleAxes(array('x', 'y'));
$Chart->setDataRange(0, $max);
$Chart->addAxisRange(0, 1, $nummonths);
$Chart->addAxisRange(1, 0, $max);
#$lineChart->addBackgroundFill('bg', 'EFEFEF');
#$lineChart->addBackgroundFill('c', '000000');