I am using Simple html DOM to parse different elements from submitted html documents. I have been trying to figure out how to check for the following
<meta http-equiv="refresh" content="100">
I have tried to use.
foreach($html->find('meta') as $element){
if($element->http-equiv=='refresh'){ refreshFound(); }
}
I receive the error Use of undefined constant equiv. Is there a special way I have to form the statement due to the – symbol?
It should be
$element->attrOutput
Simple Check
Output
Note*
if you use
$element->attr["http-equiv"]Directly it would generate the error below because sites sometimes don’t havehttp-equiv