Is it possible to use HTML in the guestbook created with PHP?

When creating a guestbook with PHP, it is possible to allow the use of HTML by properly sanitizing and validating user input to prevent any malicious code injection. This can be done by using functions like htmlspecialchars() to escape special characters and strip_tags() to remove any unwanted HTML tags.

<?php
// Retrieve user input from form submission
$name = htmlspecialchars($_POST['name']);
$message = htmlspecialchars($_POST['message']);

// Display the sanitized input in the guestbook
echo "<strong>Name:</strong> $name <br>";
echo "<strong>Message:</strong> $message <br>";
?>