view raw
BottledTurtles BottledTurtles - 10 months ago 65
PHP Question

How to get html codes between two tags

Here's HTML Codes:

<div class="body" style="text-align: justify;padding: 10px;">

I want to get innerHTML of a div tag which has


Use XPath selector for tasks similar to this.

$dom = new DomDocument();
$finder = new DomXPath($dom);
$nodes = $finder->query("//*[contains(@class, '$classname')]");