Tag Archives: php snippet

Php : Get name and value of all input tags on a page with DomDocument

By | August 4, 2012

The following code snippet will extract all input tag names and values as an associative array, from a given html page. [sourcecode language=”php”] /* Generic function to fetch all input tags (name and value) on a page Useful when writing automatic login bots/scrapers */ function get_input_tags($html) { $post_data = array(); // a new dom object… Read More »