You will get true every time, because you are setting the variable, not asking if $a is equal to $b. You are saying $a IS $b, and it goes ‘well, that’s true’.
As for the != ” thing, I’m not 100% sure if php sees an empty string as truey or not (I’m more of a js guy, but php and js are basically the same). Now that I think about it, it probably doesn’t, so you could just go:
but just be sure to check that it gives you the result you want.