What are the potential security risks of using file_get_contents to integrate HTML content into a PHP page?

Using file_get_contents to integrate HTML content into a PHP page can pose security risks such as allowing for remote code execution, exposing sensitive information, and opening the door to cross-site scripting attacks. To mitigate these risks, it is recommended to sanitize the HTML content before including it in the PHP page.

// Sanitize the HTML content before including it in the PHP page
$html_content = file_get_contents('example.html');
$sanitized_content = strip_tags($html_content, '<p><a><img>'); // Allow only specific HTML tags
echo $sanitized_content;