php if statement

I would like to print a value based on an if statement. I want to model it after this:

[php]<?php if($listing['property_type']) : ?>Type: <?php echo $listing['property_type'] ?>
<?php endif; ?>[/php]

which is in a working site. this check to see if the property_type field has a value and if so, then print the info.

My problem is instead of having a predeclared variable I have this to work with {listing_agent_first_name}

so I want an if statement that says:

IF {listing_agent_first_name} = whatever then print this bit of HTML

this is what I tried and failed miserably :slight_smile:

[php]<?php $name = {listing_agent_first_name}; if($name == "Joe") : ?><?php endif; ?>[/php]

Not really sure how thats working since the syntex is wrong. But, just do

<?=($varname ? "true" : "false") ?>
Sponsor our Newsletter | Privacy Policy | Terms of Service