0
Not only spaces, but any other letter, for example.
Is there any function that will return this to me?
I’ve tried to :
public function verifica_nome()
{
return substr_count($this->name, " ");
}
But the same always returns 0...
0
Not only spaces, but any other letter, for example.
Is there any function that will return this to me?
I’ve tried to :
public function verifica_nome()
{
return substr_count($this->name, " ");
}
But the same always returns 0...
2
Use this php function that returns an integer with the amount: http://php.net/manual/en/function.substr-count.php
echo substr_count("oi tudo bem?"," ");
Will show:
2
I was using this function. But it always returned 0.
Look here: http://www.w3schools.com/php/showphp.asp?filename=demo_func_string_substr_count
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
Have the
$this->name
before running to see if she has the text she thinks she is. Your real problem should be this.– Maniero