1. suin

    Posted

    suin
Changes in title
+制御文字を取り除く方法(改行コードは保持)
Changes in tags
Changes in body
Source | HTML | Preview
@@ -0,0 +1,7 @@
+```php
+<?php
+preg_replace('/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/', '', $string); // The line feed and carriage return will be saved.
+```
+
+ここから拝借:
+http://stackoverflow.com/questions/1497885/remove-control-characters-from-php-string