What is the difference between Plaintext and Innertext of an element in Simple HTML dom parser in PHP?
509
What is the difference between Plaintext and Innertext of an element in Simple HTML dom parser in PHP?
Example:
$html->find('title')[0]->innertext
$html->find('title')[0]->plaintext
Answer
Solution:
According to the Simple HTML DOM parser documentation the difference is next:
Answer
Solution:
Plaintext:
Plain text is used to find Element based on their tag names. Example: below example will find title. $html->find('title')[0]->plaintext
Innertext as name suggest Innertext is used to manipulate inner content of tags. Example: below example will find tag. $html->find('h1')[0]->innertext