回答編集履歴
1
コードの最適化
answer
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
```php
|
2
2
|
function is_array_empty($InputVariable) {
|
3
|
-
$
|
3
|
+
$result = true;
|
4
4
|
|
5
5
|
if (is_array($InputVariable) && count($InputVariable) > 0) {
|
6
6
|
foreach ($InputVariable as $Value) {
|
7
|
-
$
|
7
|
+
$result = $result && is_array_empty($Value);
|
8
8
|
}
|
9
9
|
} else {
|
10
|
-
$
|
10
|
+
$result = empty($InputVariable);
|
11
11
|
}
|
12
12
|
|
13
|
-
return $
|
13
|
+
return $result;
|
14
14
|
}
|
15
15
|
```
|
16
16
|
|