<?php class ArrayHelper{ static function removeEmpty(& $arr, $trim = TRUE) { foreach ($arr as $key => $value) { if (is_array($value)) { self::removeEmpty($arr[$key]); } else { $value = trim($value); if ($value == '') { unset($arr[$key]); } elseif ($trim) { $arr[$key] = $value; } } } }
???? ? ??(?? ??? ??? ?? ??) ??
Usage:
@code php
$arr = array('', 'test', ' ');
ArrayHelper: : RemoveEmpty($arr);
dump($arr);
?? ???? 'test'? ?? ????
@endcode
@param array $arr ??? ??
@param boolean $ ?? ?? ??? ?? ??? ???? ?? ???
? ???? ?? ???? ???? ????? ?? ???? ????? ????????. ?????? ???? ?? ??????! ? ???? ?? ???? ?? ?????? ?????. ??? ???? ???? ??? ????. ??? ??? ?? ??? ?? ??? ???? ????! ??? ?? ?? ??? ???? ????? ????. ???: admin@php.cn
?? ??

26 Mar 2025
? ??? & lt; thread & gt; ???, ?? ? ??? ?? ??. ?? ??? ??????? ?? ??? ???? ??? ?????.

24 Feb 2025
iOS 18.1, iPados 18.1 ? MacOS 15.1 Sequoia? ??? ????? ?????. Siri? ??? ?? ??? ??????. ?, ? ??? ?? ???? ???? Siri? ?? ? ? ????. ???, ??? ? ?? ???? ?? ????? ?? ??????. Siri? ??? ?? ??? ? ? ?? ???? ???? ??? ??? ??? ??? ??? ?? ?????. ?? Apple? ??? ??? ???? ?? ?? ???? ????. ??? ?? ??? Siri ??? ??? Chatgpt ?? ??? ???? ?? ?? ??? ????? ( "Apple Intel"???? ??? ? ????.

20 Apr 2025
??? JavaScript?? ?????. ??? ??? ??? ?? ?? ???? ??? ??? (?? FN ? ??)? ???? ?? (ha!) ??? ??? ?? ??????.

05 Apr 2025
???? ??? ???? ????? ????? "??? ????"???? ???? 10 ?? ?? ??? ?? ? ????. ??? ?? ??? ?? ??? ????. 1. ??? ??

01 Nov 2024
Go? ??? ?? ??? ???? ? ????? Go? ??? LMS(????? ?? ???)? ???? ?? ??, ??? ?? ? ?? ?? ??? ?????. ????? ??? ?? ??

28 Sep 2024
cmhtml.dll? ? ????? ??? ?? ???? ???? ??? ? ??? ?? ?? ????. cmhtml.dll? ?? ???? ????? ???? ??? ??????? ?????. ???? ?? ????? ?? ???? ???? ????


??? ??

??? ?? ????? PHP ?????
??? ?? ????? PHP ?????

50?? ??? ??? PHP ???? ??
??? PHP ????, ??? ????? ??? ???? ?????

??? ???? ?? ?? PHP ?????
??? ???? ?? ?? PHP ?????
