astralaaron Posted May 20, 2007 Share Posted May 20, 2007 what does || mean exactly? i couldnt find it on php.neti originally thought it was just like 'and' like saying if (!$var and !$var) was the same as (!$var || !$var) Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted May 20, 2007 Share Posted May 20, 2007 || is the same as or, you should be able to find it under operators: http://php.net/manual/en/language.operators.logical.php&& is the same as andI tend to use || and && instead of or and and, perhaps mainly because I've written much in C/C++, but also as i think it gives the statements are more structured look... Link to comment Share on other sites More sharing options...
astralaaron Posted May 20, 2007 Author Share Posted May 20, 2007 || is the same as or, you should be able to find it under operators: http://php.net/manual/en/language.operators.logical.php&& is the same as andI tend to use || and && instead of or and and, perhaps mainly because I've written much in C/C++, but also as i think it gives the statements are more structured look...ahh cool thanks for the link and the information. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 21, 2007 Share Posted May 21, 2007 While "||" does mean "or", and "&&" does mean "and", the operators are not strictly the same. "||" and "&&" work at a different (higher) precedence then "or" and "and".http://www.php.net/manual/en/language.operators.logical.php Link to comment Share on other sites More sharing options...
astralaaron Posted May 24, 2007 Author Share Posted May 24, 2007 While "||" does mean "or", and "&&" does mean "and", the operators are not strictly the same. "||" and "&&" work at a different (higher) precedence then "or" and "and".http://www.php.net/manual/en/language.operators.logical.php ahh cool thanks for that link! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.