Using below code we can get that space is available or not btween two or more words.
$str = 'Hello World!';
if ($str == trim($str) && strpos($str, ' ') !== false) {
echo 'has spaces, but not at beginning or end';
}
else{
echo 'There are no any space in sentence';
}
ConversionConversion EmoticonEmoticon