public function Validname()
{
return !empty($this->_nom);
}
I don't understand the meaning of return !empty($this->_nom);
thanks.
what does this line mean?
Moderator: General Moderators
Re: what does this line mean?
Your code:
!empty = not empty.
$this->_nom = (private $_nom; in class)
if you want a detailed explanation what $_nom does in your case give us your all class code.
Code: Select all
public function Validname()
{
return !empty($this->_nom);
}$this->_nom = (private $_nom; in class)
if you want a detailed explanation what $_nom does in your case give us your all class code.
Re: what does this line mean?
Thanks, but I don't quite understand what "return !empty" means together.
Re: what does this line mean?
! means not.
So you're returning opposite of whether or not $this->_nom is empty. The idea being, if the variable is not empty, or !empty(), then the name must be valid, hence the function name "Validname"
So you're returning opposite of whether or not $this->_nom is empty. The idea being, if the variable is not empty, or !empty(), then the name must be valid, hence the function name "Validname"
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: what does this line mean?
Thanks for your help pickle; my problem was the hidden 'if' in the code, I didn't know that.
Thanks again.
Thanks again.