I'm reading the following article on how to use htmlspecialchars() properly:
In the article the following syntax is used as an example:
<?php header('Content-Type: text/html; charset=UTF-8'); ?>
<!DOCTYPE html>
<?php
$input = <<<INPUT
' onmouseover='alert(/Meow!/);
INPUT;
/**
* NOTE: This is equivalent to using htmlspecialchars($input, ENT_COMPAT)
*/
$output = htmlspecialchars($input);
?>
<html>
<head>
<title>Single Quoted Attribute</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div>
<span title='<?php echo $output ?>'>
What's that latin placeholder text again?
</span>
</div>
</body>
</html>
I am still pretty much a noob obviously and have never seen the <<
Just wondering if anyone could briefly explain what this syntax is meant to do. I'm trying to understand the article, but I sort of need to understand what this code is doing first.