notanoob
-
Posts
4 -
Joined
-
Last visited
Never
Posts posted by notanoob
-
-
but i need to analyse that http-referrer to be like http://www.example.com/ without the trailing stuff eg
Use string search to find position of 3rd slash and then do a substring from 0 to that position. Then do your comparison on that substring.
-
include $page . '.php';
-
$doc = DOMDocument::loadHTMLFile("test.html");
$ele = $doc->getElementById('di');
//missing ability to setinnerhtml,
//something like $ele->setInnerHTML("<div>sdfsdfdsf<b>dsfdsF</b></div>");
//or
//something like setInnerHTML($ele, "<div>sdfsdfdsf<b>dsfdsF</b></div>");
echo $doc->saveHTML();
Does anyone know a way to implement a setInnerHTML type function to remove all the children of a Dom Element and replace them with new children based on a string of HTML? (I don't want to use createElement and all that directly, obviously, but some suggestion of how to use that inside the setInnerHTML function would be nice)
PHP to parse DOM and setInnerHTML?
in PHP Coding Help
Posted
the ability to do this could revolutionize web programming! This is why they didn't include it in PHP standard--or any other serverside language--because it would render the need for templating engines useless!