Converting a table of html inputs to PHP array -


i trying information html table php array. easy following method:

function getdata($table) {     $dom = new domdocument;     $dom->loadhtml($table);      $items = $dom->getelementsbytagname('tr');      function tdrows($elements)     {         $str = "";         foreach ($elements $element)         {             $str .= $element->nodevalue . ", ";         }         return $str;     }     foreach ($items $node)     {         echo tdrows($node->childnodes) . "<br />";     } } 

the problem facing content of table has html inputs , want value of inputs. table of form:

<table> <tr><td><input type="text" /></td><td><input type="text" /></td><td><div class="add">add</div></td></tr> </table> 

will able modify current function accomplish or should try approach

as php server-side, not able value of input unless submit inputted value server, example using post or when form submitted. should use javascript if want value of input without having submit form. if doesn't answer question please try ask more : )


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -