$str = array("\n\r\t", '\n\r\t', 'abc\n', 'xyz', ' ');
foreach ($str as $s)
{
if (ctype_space($s))
echo "string: $s - include only whitespace characters <br />";
else
echo "string: $s - NOT include only whitespace characters <br />";
}
/*
run:
string: - include only whitespace characters
string: \n\r\t - NOT include only whitespace characters
string: abc\n - NOT include only whitespace characters
string: xyz - NOT include only whitespace characters
string: - include only whitespace characters
*/