teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

コードの最適化

2017/03/13 08:30

投稿

Everatch
Everatch

スコア241

answer CHANGED
@@ -1,16 +1,16 @@
1
1
  ```php
2
2
  function is_array_empty($InputVariable) {
3
- $Result = true;
3
+ $result = true;
4
4
 
5
5
  if (is_array($InputVariable) && count($InputVariable) > 0) {
6
6
  foreach ($InputVariable as $Value) {
7
- $Result = $Result && is_array_empty($Value);
7
+ $result = $result && is_array_empty($Value);
8
8
  }
9
9
  } else {
10
- $Result = empty($InputVariable);
10
+ $result = empty($InputVariable);
11
11
  }
12
12
 
13
- return $Result;
13
+ return $result;
14
14
  }
15
15
  ```
16
16