mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Added the new function "set_when_empty"
This commit is contained in:
parent
f2539395c3
commit
127f53e8c8
@ -2386,6 +2386,17 @@ function set_unless_defined (&$var, $default) {
|
||||
}
|
||||
}
|
||||
|
||||
function set_when_empty (&$var, $default) {
|
||||
if (empty($var)) {
|
||||
$var = $default;
|
||||
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function sort_by_column (&$array_ref, $column) {
|
||||
if (!empty($column)) {
|
||||
usort($array_ref, function ($a, $b) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user