php if statement ignores condition -


i'm trying check if user countries , not ip address, enter if following statement checks $country ignors ip check condition

if($country == "usa" || $country == "can" && $ipc != "1x.1x.1x.1x" && $ipc != "2x.2x.2x.2x"){ 

if(($country == "usa" || $country == "can") && $ipc != "1x.1x.1x.1x" && $ipc != "2x.2x.2x.2x")

you want use ( ) around || condition php evaluates correctly

this in math, use of order of operations.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -