Created
August 10, 2014 06:35
-
-
Save Drunkar/c7ca6eccfcc3601ec9b1 to your computer and use it in GitHub Desktop.
PHPで入力文字をいろいろする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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