Skip to content

Instantly share code, notes, and snippets.

@suin
Created December 6, 2011 02:24
Show Gist options
  • Save suin/1436415 to your computer and use it in GitHub Desktop.
Save suin/1436415 to your computer and use it in GitHub Desktop.
制御文字を取り除く方法(改行コードは保持) ref: http://qiita.com/items/1295
<?php
preg_replace('/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/', '', $string); // The line feed and carriage return will be saved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment