php - combining getElementsByTagName and getElementsByClassName DOMDocument
i try to combininggetElementsByTagName
andgetElementsByClassName
but i got some error.
for example<p class="castplot">some text here.</p>
i want to getsome text here
.
here what i try.
$information = html_entity_decode ($value['information']);
$dom = new DOMDocument();
@$dom->loadHTML($information);
$p1 = $dom->getElementsByTagName('p')->getElementsByClassName('castplot')->textContent;
error i get
Uncaught Error: Call to undefined method DOMNodeList::getElementsByClassName() in C:\xampp\htdocs\piratefiles\fetch_details.php:21 Stack trace:
0 {main} thrown in