I am trying to add text inside a html tag:
$html = '<html>
<head>
<title>title</title>
</head>
<body style="background-color:yellow;">
<p>some text</p>
</body>
</html>';
now I want this to appear at the end of the body tag:
$replacement = '<footer>Footer Text</footer>';
so that the result would look like this:
<html>
<head>
<title>title</title>
</head>
<body style="background-color:yellow;">
<p>some text</p>
<footer>Footer Text</footer>
</body>
</html>
I looked for a similar answer with preg- or ereg replace but there only where solutions where the text is replaced completely.
Thanks!