How to check if a SimpleHTMLDom element does not exist

前端 未结 4 1050
忘了有多久
忘了有多久 2021-01-18 15:16

SimpleHtmldom can be used to extract the contents of the first element with class description.

$html = str_get_html($html);
$html->find(\'.d         


        
4条回答
  •  野的像风
    2021-01-18 16:16

    if(($html->find('.description', 0))) {
        echo 'set';
    }else{
        echo 'not set';
    }
    

    http://www.php.net/manual/en/control-structures.if.php

提交回复
热议问题