如何检查字符串only是否包含空格?
最佳答案
if (strlen(trim($str)) == 0)
或者如果你不想包含空字符串,
if (strlen($str) > 0 && strlen(trim($str)) == 0)
关于php - 如果字符串只包含空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2352779/
如何检查字符串only是否包含空格?
最佳答案
if (strlen(trim($str)) == 0)
或者如果你不想包含空字符串,
if (strlen($str) > 0 && strlen(trim($str)) == 0)
关于php - 如果字符串只包含空格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2352779/