回答編集履歴
2
コード例の追加
answer
CHANGED
@@ -16,4 +16,15 @@
|
|
16
16
|
$hoge = join("・", $fruit);
|
17
17
|
echo($hoge);
|
18
18
|
|
19
|
+
```
|
20
|
+
mapも便利です。
|
21
|
+
```php
|
22
|
+
<?php
|
23
|
+
$fruit = array("apple", "orange", "grape");
|
24
|
+
function addPointChar($str) {
|
25
|
+
return $str."・";
|
26
|
+
}
|
27
|
+
$res = join("", array_map("addPointChar", $fruit));
|
28
|
+
echo($res);
|
29
|
+
?>
|
19
30
|
```
|
1
書式の改善
answer
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
py4s-tnk様のコードを少し短く書いた場合。
|
2
|
-
まぁ、好みの問題ですが。
|
3
|
-
|
4
1
|
```php
|
5
2
|
<?php
|
6
3
|
$fruit = array("apple", "orange", "grape");
|