remove each() keyword as it is deprecated as of php-7.2, fixes #479
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -20,27 +20,22 @@
|
||||
/**
|
||||
* Returns Array, whose elements have been checked whether thay are empty or not
|
||||
*
|
||||
* @param array The array to trim
|
||||
* @param array $source
|
||||
* The array to trim
|
||||
* @return array The trim'med array
|
||||
* @author Florian Lippert <flo@syscp.org>
|
||||
*/
|
||||
|
||||
function array_trim($source)
|
||||
{
|
||||
$returnval = array();
|
||||
|
||||
if(is_array($source))
|
||||
{
|
||||
while(list($var, $val) = each($source))
|
||||
{
|
||||
if($val != ' '
|
||||
&& $val != '')$returnval[$var] = $val;
|
||||
if (is_array($source)) {
|
||||
foreach ($source as $var => $val) {
|
||||
if ($val != ' ' && $val != '') {
|
||||
$returnval[$var] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$returnval = $source;
|
||||
}
|
||||
|
||||
return $returnval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user