TheJoey Posted October 22, 2009 Share Posted October 22, 2009 Mabye a stupid question just wondering what it does, and if it works if u only put | one of these. Quote Link to comment https://forums.phpfreaks.com/topic/178567-what-does-do-in-code/ Share on other sites More sharing options...
dreamwest Posted October 22, 2009 Share Posted October 22, 2009 | is a deliminator aka a seperator || is OR ....so $one = 'three'; if($one =='three' || $one=='two'){ echo "Either two or three"; } Logically: $one = 'three'; if($one =='three' OR $one=='two'){ echo "Either two or three"; } Quote Link to comment https://forums.phpfreaks.com/topic/178567-what-does-do-in-code/#findComment-941711 Share on other sites More sharing options...
TheJoey Posted October 22, 2009 Author Share Posted October 22, 2009 Thank you sir Quote Link to comment https://forums.phpfreaks.com/topic/178567-what-does-do-in-code/#findComment-941714 Share on other sites More sharing options...
trq Posted October 22, 2009 Share Posted October 22, 2009 In php... | is the bitwise Or (inclusive Or) operator. || is the logical Or operator. Operators are all covered within the manual. Quote Link to comment https://forums.phpfreaks.com/topic/178567-what-does-do-in-code/#findComment-941716 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.