2

I have a code like this.

<form id="mainForm" method="post" action="">
<div id="info">6.897882999999999, 79.92221100000006</div>
<input id="submit" type="submit" name="submit" value="submit"/>
</form>

I want to assign div tag value (6.897882999999999, 79.92221100000006) to php variable using div id . Is it possible. if yes, how to do this. thanks

Sasindu H
  • 1,538
  • 7
  • 24
  • 43

1 Answers1

3

The easiest solution: http://simplehtmldom.sourceforge.net/

Alternatives: Robust and Mature HTML Parser for PHP

Community
  • 1
  • 1
Edgar Velasquez Lim
  • 2,426
  • 18
  • 15
  • I'm assuming you've picked the first link as your implementation. What are you getting stuck on in the tutorial? – Edgar Velasquez Lim Jul 20 '11 at 11:25
  • how to assign value to php variable ? – Sasindu H Jul 20 '11 at 11:34
  • Suggested third party alternatives to [SimpleHtmlDom](http://simplehtmldom.sourceforge.net/) that actually use [DOM](http://php.net/manual/en/book.dom.php) instead of String Parsing: [phpQuery](http://code.google.com/p/phpquery/), [Zend_Dom](http://framework.zend.com/manual/en/zend.dom.html), [QueryPath](http://querypath.org/) and [FluentDom](http://www.fluentdom.org). See [Best Methods to parse HTML](http://stackoverflow.com/questions/3577641/best-methods-to-parse-html/3577662#3577662) – Gordon Jul 20 '11 at 11:51