PHP: Help with if OR issue -


had twice now, don't know problem is, have normal if statement, or attribute

if((checkblock($showu['id'], $user, 'wall') != 1) || (checkblock($showu['id'], $user, 'wall', 1) == 1)) {  

i want check whether first checkblock != 1, or if checkblock == 1

first if checkblock should true, if have blocked user , user tries visit me.

second should true if have blocked user , try visit him.

the first ifstatement works code above, not if statement (the if have blocked , visits him)..

but second works if remove first statement.. want check both.

how can make them both check work? have tried or, didnt affect issue.

php skipping second check when first true because of short-circuit boolean evaluation. is, if have (a || b) , true, there's no need check b because conditional has passed. if want check both conditions need use , not or.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -