回答編集履歴
2
コード例の追加
test
CHANGED
@@ -35,3 +35,25 @@
|
|
35
35
|
|
36
36
|
|
37
37
|
```
|
38
|
+
|
39
|
+
mapも便利です。
|
40
|
+
|
41
|
+
```php
|
42
|
+
|
43
|
+
<?php
|
44
|
+
|
45
|
+
$fruit = array("apple", "orange", "grape");
|
46
|
+
|
47
|
+
function addPointChar($str) {
|
48
|
+
|
49
|
+
return $str."・";
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
$res = join("", array_map("addPointChar", $fruit));
|
54
|
+
|
55
|
+
echo($res);
|
56
|
+
|
57
|
+
?>
|
58
|
+
|
59
|
+
```
|
1
書式の改善
test
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
py4s-tnk様のコードを少し短く書いた場合。
|
2
|
-
|
3
|
-
まぁ、好みの問題ですが。
|
4
|
-
|
5
|
-
|
6
|
-
|
7
1
|
```php
|
8
2
|
|
9
3
|
<?php
|