Answers for "php check if string contains space"

PHP
0

if name value contains space in php

if ($str == trim($str) && strpos($str, ' ') !== false) {
    echo 'has spaces, but not at beginning or end';
}
Posted by: Guest on March-07-2021
0

check if string contains only whitespace php

ctype_space("  ") //returns true

ctype_space("   a   ") //returns false
Posted by: Guest on July-03-2020

Code answers related to "php check if string contains space"

Browse Popular Code Answers by Language