Pablo
Pablo

Reputation: 5087

simple_html_dom finding input in html commented section

I need to find an html input that is in an html commented section

<!-- <input type="hidden" name="ab_cde" value="12345" /> -->

the code

foreach($html->find('input') as $element) 
    {   

    }   

is not working to find it. How can it be done?

Upvotes: 0

Views: 185

Answers (1)

vv01f
vv01f

Reputation: 372

you can do via $html->find('comment') and then use an regular expression for your input in there or initialize the comments content as another html object (http://php.net/manual/en/domdocument.loadhtml.php) to be searched like you tried before.

Upvotes: 1

Related Questions