How can PHP be used to prevent users from inputting HTML tags in a text box?

To prevent users from inputting HTML tags in a text box, you can use the PHP strip_tags() function. This function removes any HTML and PHP tags from a string, ensuring that only plain text is accepted as input.

$input = $_POST['textbox']; // Assuming the input comes from a POST request
$clean_input = strip_tags($input);
echo $clean_input; // Use the clean input in your application