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:
if($post->post_content)
but just be sure to check that it gives you the result you want.
Is this right? It works, I just want to make sure it is the correct way and most efficient way.
Also, you need to see what $post->post_content would look like if it was empty, is it an empty string?
If it's an empty string the statement would start with:Otherwise it would be:
I was just making sure it was clean or if there was a better way. Thanks!
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.