I solve it this type of issue with Event Rocket Plugin.

That actually like it

if(!empty($_POST[‘event_id’])){
$attendees = eventrocket_rsvp()->attendance( $_POST[‘event_id’] );
}

Here I check with , event_id is empty or not 🙂

But original solution I take from stackoverflow :

That is to check with id is empty or not

Use empty() to check if it is available. Try with –

will generate the error if host is not present here

if(!empty($_GET[“host”]))
if($_GET[“host”]!=””)