Merge branch 'master' into lite

This commit is contained in:
王怡栋
2022-01-19 08:44:43 +08:00
254 changed files with 11731 additions and 2120 deletions
+36
View File
@@ -917,3 +917,39 @@ function htmlSpecialString($string, $flags = '', $encoding = 'UTF-8')
if(!$flags) $flags = defined('ENT_SUBSTITUTE') ? ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 : ENT_QUOTES;
return htmlspecialchars($string, $flags, $encoding);
}
if (!function_exists('array_column'))
{
function array_column(array $input, $columnKey, $indexKey = null)
{
$output = array();
foreach ($input as $row) {
$key = $value = null;
$keySet = $valueSet = false;
if (null !== $indexKey && array_key_exists($indexKey, $row)) {
$keySet = true;
$key = (string) $row[$indexKey];
}
if (null === $columnKey) {
$valueSet = true;
$value = $row;
} elseif (\is_array($row) && \array_key_exists($columnKey, $row)) {
$valueSet = true;
$value = $row[$columnKey];
}
if ($valueSet) {
if ($keySet) {
$output[$key] = $value;
} else {
$output[] = $value;
}
}
}
return $output;
}
}