I’m using the Yii framework.
I want to show specific content if a user did not select their location.
So, I am using the following code to show content if no state is selected:
<?php if ($state == NULL) { ?>
And I am using the following code if no city is selected:
<?php if ($city == NULL) { ?>
And they are working perfectly, but how can I combine those two statements so that I can show content if they have no state, AND, no city selected?
<?php if ($city == NULL && $state == NULL) { ?>I suggest that you read about operators in PHP. Also worth reading is the PHP symbol reference FAQ of SO.