How do I add/format an if/else statement?

I would like to add some additional logic to the if/else statement below. What I would like to do is move the strtoupper($_POST[‘attendeecode’])==“INV” attendee code to another if statement and make it do something else.

<?php
    if (strtoupper($_POST['attendeecode'])=="SPK" || strtoupper($_POST['attendeecode'])=="GRT" || strtoupper($_POST['attendeecode'])=="INV" ||strtoupper($_POST['attendeecode'])=="EMP" || $_POST['checkcode']=="CHECK"){ 
    		echo '<h1 class="thanks-title">Thank you. <br><br>Your submission has been received.</h1>';
    	}
    	else {this section does something when the if statement isn't true}

So it would be something like:

if (strtoupper($_POST['attendeecode'])=="SPK" || strtoupper($_POST['attendeecode'])=="GRT" ||strtoupper($_POST['attendeecode'])=="EMP" || $_POST['checkcode']=="CHECK"){ 
        		echo '<h1 class="thanks-title">Thank you. <br><br>Your submission has been received.</h1>';
        	}
if (strtoupper($_POST['attendeecode'])=="INV")   {echo '<meta http-equiv="Refresh" content="0; url=https://www.somewebsite.com
           }
      else {this section does something when the if statements aren't true}

I’m just not sure of the syntax.

The strtoupper is completely pointless and redundant.

function in_array_any($needles, $haystack)
{
    return (bool)(array_intersect($needles, $haystack));
}

        if (in_array_any(['spk', 'grt', 'emp', 'check'], $_POST['attendeecode'])) {
            echo '<h1 class="thanks-title">Thank you. <br><br>Your submission has been received.</h1>';
        }
Sponsor our Newsletter | Privacy Policy | Terms of Service