33
You may use something like this:
if (strpos($r, ' ') > 0) {
echo 'A white space exists between the string';
}
else
{
echo 'There is no white space in the string';
}
This will detect a space, but not any other kind of whitespace.