woody79 Posted August 20, 2007 Share Posted August 20, 2007 How do i preg_match a single space Quote Link to comment https://forums.phpfreaks.com/topic/65802-preg_match-a-space/ Share on other sites More sharing options...
MadTechie Posted August 20, 2007 Share Posted August 20, 2007 white space (space, tab etc) (better option) if (preg_match('/\s/', $data, $regs)) { $result = $regs[0]; } echo $result; Match the ASCII or ANSI character with position 0x20 (32 decimal) in the character set if (preg_match('/\x20/', $data, $regs)) { $result = $regs[0]; } else { $result = ""; } Quote Link to comment https://forums.phpfreaks.com/topic/65802-preg_match-a-space/#findComment-328842 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.