Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
The lake of this slash causes the file op.css to not load so i don't get its content anymore. This slash is mandatory but why it didn't work in my case i don't understand why ...
$link = '<link rel="stylesheet" href="op/css/op.css" type="text/css" />';
$html = '<html xmlns ... </html>'; // Entire web page content.
addbeforehead($html, $link); // Here is the problem, the function add the link just before </head> tag but it always remove the slash
function addbeforehead(&$document, $content){
$dom = new DOMdocument();
@$dom->loadHTML($document);
$xpath = new DOMXPath($dom);
$head = $xpath->query('//head')->item(0);
$appendme = new DOMCdataSection($content);
$head->appendChild($appendme);
return $dom->saveHTML();
}