php check if name has a space in between code example
Example: if name value contains space in php
if ($str == trim($str) && strpos($str, ' ') !== false) {
echo 'has spaces, but not at beginning or end';
}
if ($str == trim($str) && strpos($str, ' ') !== false) {
echo 'has spaces, but not at beginning or end';
}