simpledom - get span content text using simple DOM parser php -
i have following div,
<div class="info"> review status: <span style="color:green;"><strong>active</strong></span> | order #: <strong> 22436 </strong> | transaction date: <strong><span class="mm_panel_text"> 3/28/15 </span> </strong> <div class="separator-small"></div> <div class="separator-small"></div> <a href="/survey/flag/9287742"><i class="fa fa-flag"></i> flag review »</a> <a href="/user/contact/nintytwomw/comment/9287742"><i class="fa fa-envelope"></i> email reviewer »</a> <a href="javascript:view_detail(8713492)"><i class="fa fa-search"></i> view details »</a> <a href="/survey/reply/9287742"> <i class="fa fa-bullhorn"></i> post public reply »</a> <a href="#" id="lnk_commentfeature_8713492" data-id="8713492" data-featured="no"><i class="fa fa-star"></i> feature</a> <!-- end seller admin edit options --> <div class="separator"></div> <h3 class="subheader">tag review <a href="#" data-reveal-id="user_terms"><i class="fa fa-question-circle"></i></a></h3> <ul class="tagdisplay taglist" survey_id="8713492" tags="[]"></ul> <div class="separator"></div> </div>
now want access class="mm_panel_text" , content date.i wrote code doesn't work.
foreach($html1->find('span[class="mm_panel_text"]') $transaction_date){ $transactiondate[] = $transaction_date->innertext; // $rating[] = $ratings->plaintext; if (sizeof($transactiondate)==15) { var_dump($transactiondate); } //var_dump($links); }
there many divs of class. use loop access elemnts' content. issue code? doesn't display anything.
this it
$transactiondate = $html1->find('span[class="mm_panel_text"]')->plaintext ;
or
$transactiondate = $html1->find('span[class=mm_panel_text]')->plaintext ;
edit:
in case loop on div's having class mm_panel_text
can this
foreach($html1->find('span.mm_panel_text') $transaction_date)
Comments
Post a Comment