|
|
delete_nulls_in_array() Функция удаляет из числовых массивов пустые значения массивов, null, пробелы, табы, переносы строки |
|
Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / PHP-function for arrays / delete_nulls_in_array() Функция удаляет из числовых массивов пустые значения массивов, null, пробелы, табы, переносы строки
Russian
|
delete_nulls_in_array() The function removes from the numerical arrays the empty values of arrays, null, spaces, tabs, line breaks |
|
Обновлённый PHP-Fusion Bogatyr / Free CMS PHP-Fusion 7 Bogatyr / PHP-function for arrays / delete_nulls_in_array() The function removes from the numerical arrays the empty values of arrays, null, spaces, tabs, line breaks
English
|
|
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 20
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 21
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\search_bbcode_include.php on line 39
PHP
<?php
// RU: Функция удаляет // '' // null // пробел // таб // перенос строки
// EN: The function removes // '' // null // space // tab // wrapping the line
// RU: ключи оставшихся элементов не изменяются
// EN: The keys of the remaining elements do not change
function delete_nulls_in_array( $res=array(), $keys = array(null, '', ' ', '
', ) ) {
// RU: не удаляет пустое значение
// EN: does not delete the empty value
// $array_empty = array(null); $res = array_diff($res, $array_empty);
// $array_empty = array(""); $res = array_diff($res, $array_empty);
// $res = array_filter ($res );
// $res = array_filter( $res, function($el){ return !empty($el);} );
-
foreach ( $keys as $k=>$v ) {
$key = array_search($v, $res); unset($res[$key]);
}
return $res;
}
?>
|
Добавить комментарий Пожалуйста, залогиньтесь для добавления комментария.
|
| HTML-code and BB-code for blogs and forums |
|
<a href="https://php-fusion.vveb.ws/php-fusion.php?id=36"></a>
[url=https://php-fusion.vveb.ws/php-fusion.php?id=36][/url]
|
|