woody79 Posted August 20, 2007 Share Posted August 20, 2007 How do i preg_match a single space 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 = ""; } Link to comment https://forums.phpfreaks.com/topic/65802-preg_match-a-space/#findComment-328842 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.