Jump to content

preg_match a space


woody79

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.