Showing conditional divs using php and if/else statements

If you want to show some divs instead of others on a website IF some condition is met you can use the following piece of code:

php if ($artist_id == “1980”) { ?>

Some data

php } else { ?>

Some other data

<? } ?>

The data and the whole layout can be different, as in this case, but it doesn’t have to. Customize as required.

Thanks to Mellamokb @ StakOverflow.

Tagged under: ,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top