php - Using OR in a IF -


any ideas why isn't working?

if($page->slug != 'water-filters' || $page->slug != 'pet-care' || $page->slug != 'books') {   //do  }  

i think mean , instead of or because you're using not equals.

by using not equals in way statement true, if $page->slug equals 'water-filters' doesn't equal 'pet-care' , hence if statement whole returns true.

if($page->slug != 'water-filters' && $page->slug != 'pet-care' && $page->slug != 'books') {     //do  }  

Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -