PHP is executed on the server, and the resulting HTML page is sent to your browser. So if you want to add something to a page with PHP, all you have to do is rename the page from .html to .php, and add the PHP code where you want the result to appear:
index.php
<html>
<head>
</head>
<body>
<div class="border">
<?php
echo "This needs to go into the class border"
?>
</div>
</body>
</html>
Are you really trying to achieve this with PHP? It would be good and easy with JS (jQuery). I would do something like this at the end of the page if the generated string is not much longer:
/* JQuery Code */
$(document).ready(function{
$(".border").html('This needs to go into the class border');
});