Skip to content

Instantly share code, notes, and snippets.

@Drunkar
Created August 10, 2014 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Drunkar/c7ca6eccfcc3601ec9b1 to your computer and use it in GitHub Desktop.
Save Drunkar/c7ca6eccfcc3601ec9b1 to your computer and use it in GitHub Desktop.
PHPで入力文字をいろいろする
<?PHP
// 全角英数字と全角スペースを半角に変換
$input_term = mb_convert_kana($input_term, 'as', 'UTF-8');
// 連続する半角スペースを1つの半角スペースへ
$input_term = preg_replace('/\s+/', ' ', $input_term);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment