dimanche 17 décembre 2017

How to check existence of any html element by php condition?

How to check existence of any html element (with id or class) by php condition? (Wordpress website)

I've tried with the below code but didn't work and also given an error.

$new = $html->find("#banner_id");
if($new){
    echo "Exists";
} else {
    echo "Not Exists";
}

here's the error: error-image

Thanks

Aucun commentaire:

Enregistrer un commentaire