I have a problem when i try to create an SVG in PHP. I manage to create SVG when i set the string manually (like: $string = "Hello";), but when i try to get a string from another page using sessions i get the error "error on line 3 at column 8: Opening and ending tag mismatch: meta line 0 and head".
<?php
//$string = "HEEEIA"; <--- It works when i manually insert the string text
$string = $_SESSION['text-from-last-page'];
header('Content-type: image/svg+xml');
echo '<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
<text x="80" y="90" style="font:size: 8">' . $string . '</text>
</svg>';
?>