PHP if url extension action condition use

If your site URL like this dmain.com/?action=discussion or dmain.com/?action=something use below php condition

<?php if( $_GET['action'] == 'discussion' ) { ?>
    It's True.
<?php } else { ?>
    It's False.
<?php } ?>

Or

<?php if( $_GET['action'] == 'discussion' ) { ?>
    It's True.
<?php } ?>

Leave a Reply

Your email address will not be published. Required fields are marked *