View Single Post
Old 01-02-2011, 02:06 PM  
r0bman
Confirmed User
 
r0bman's Avatar
 
Industry Role:
Join Date: Sep 2010
Posts: 38
Quote:
Originally Posted by bl4h View Post
wtf ? am I missing something here


Code:
if($this->product->productType == "dog" || $this->product->productType == "cat") { }
the two pipes between them means "OR".

|| = OR
&& = AND

I mean I wouldnt do it that way but that answer your question about and and or.
This is the correct way unless you are comparing more than a few product types (Cat, Dog, Horse, Pig) If so, use the switch statement.
r0bman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote