回答編集履歴
1
コードブロックに修正
answer
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
もしかして $discriptionって arrayですか?
|
2
|
+
trim()は arrayに対しては無効です。ループしてひとつずつtrim()してください。
|
2
3
|
|
4
|
+
```php
|
3
5
|
$description = str_replace( "\xc2\xa0", " ", $description );
|
4
6
|
$description = preg_replace( '/[\n\r\t ]+/', ' ', $description);
|
5
7
|
foreach ($description as $idx => $item) {
|
6
8
|
$description[$idx] = trim($item);
|
7
|
-
}
|
9
|
+
}
|
10
|
+
```
|