Yii Framework Forum: Could someone explain me what is && - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Could someone explain me what is && Rate Topic: -----

#1 User is offline   czihong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-August 10

Posted 02 August 2010 - 09:44 AM

Hi, I know && is Logical Operators in programming language.
But when I go through the The Definite Guide to Yii , here is a example at
http://www.yiiframew...uide/form.table documents.
In the actionBatchUpdate() method, there is a statement says: $valid=$valid && $item->validate();

Could anyone tell me what does && means in this case?
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 02 August 2010 - 10:25 AM

View Postczihong, on 02 August 2010 - 09:44 AM, said:

Hi, I know && is Logical Operators in programming language.
But when I go through the The Definite Guide to Yii , here is a example at
http://www.yiiframew...uide/form.table documents.
In the actionBatchUpdate() method, there is a statement says: $valid=$valid && $item->validate();

Could anyone tell me what does && means in this case?


I the first operand evaluates to false, no need to evaluate the second operand.

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#3 User is offline   czihong 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-August 10

Posted 02 August 2010 - 11:25 AM

thanks a lot tommy. make sence now
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users