- htmlentities: documentation ( source)
<?php
$str='<!doctype html>
<html>
<head>
<title>My Calculator</title>
</head>
<body align="center">
<b> MY CALCULATOR</b>
<table border="0" cellpadding="3" cellspacing="0" align="center">
<tr><td>
<form method="POST" action="">
<label for="First number">
First number:</label>
</td>
<td>
<inputtype="text"name="first_num"
maxlength="20"/>
</td>
</tr>
<br/>
<tr>
<td>
<label for="Second number">
Second number:</label>
</td>
<td><input type="text" name="sec_num" maxlength="20"/></td>
</tr>
<br/>
<tr>
<td>
<input type="submit" name="opt" value="+"/>
<input type="submit" name="opt" value="-"/>
</td><td>
<input type="submit" name="opt" value="*"/>
<input type="submit" name="opt" value="/"/>
<input type="reset" value="RESET"</td>
</form>
</tr>
</table>
</body>
</html>';
echo htmlentities($str);
?>