How to get value of HTML Div using PHP -


i have div php.it given below.

$did = "<div id='primary'>value 110</div>"; 

i need value in variable 'value 110' only.i don't want use jquery,ajax or other javascript.

i need div value in php variable.

and value inside div 'value 110' coming through jquery.so run time value onclick of edit button.

php simple html dom parser may need, give try.

here's example shows how edit html element:

$html = str_get_html('<div id="hello">hello</div><div id="world">world</div>');  $html->find('div', 1)->class = 'bar';  $html->find('div[id=hello]', 0)->innertext = 'foo';  echo $html; // output: <div id="hello">foo</div><div id="world" class="bar">world</div> 

from example can create code need:

$html = str_get_html("<div id='primary'>value 110</div>"); $text = $html->find('div[id=primary]', 0)->innertext; echo $text; // prints "value 110", content inside div called "primary" 

i haven't tried code believe shuold work.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -