<form action="" method="post">
<?php if($input !== null){ //if input is submitted then show message
if(strpos($input, '[key1]') === true or strpos($input, 'key2') === true) { //find the input [key1] or [key2]
echo " input contain [key1] or [key2] ";
}else{ // input doesnt contain [key1] or [key2]
echo " input didnt contain [key1] or [key2]";
}
}else{ // showing form input
echo "
<input type='text' name='inputText' maxlength='100' data-length=100 class='form-control char-textarea' rows='3' placeholder='use [key1] or [key2]' required aria-invalid='false'/>
<input type='file' name='fileToUpload' id='fileToUpload' ><br>
<button type='submit' name='SubmitButton' class='btn btn-primary mr-1 mb-1'>Send</button>
";
}?>
</form>
here the form i made, now how can i find if the input is contain [key1]or
[key2] when they submit the form, i tried
if(strpos($input, '[key1]') === true or strpos($input, 'key2') === true)
but the result is echo " input didnt contain [key1] or [key2]";
and not echo " input contain [key1] or [key2] ";