How can I add a code before or after a spesific element using PHP Simple HTML DOM?
For example: before
<head>
add
<style> .someclass { text-align:center } </style>
output shold be:
....
<style> .someclass { text-align:center } </style>
<head>
.....
and inside some spesific div how can I add a code for example:
before parsing:
<div class="mydiv">...some original staff..</div>
after parsing should be:
<div class="mydiv"><span>my staff</span>...some original staff..</div>
I coldn't figure out. Just I achieved to replace or remove elements. Also woould appreciate if you can suggest alternative method to do this.
$html = file_get_html('http://someurl.com/some.php?id=3965');