Friday, 15 March 2013

PHP Simple HTML DOM Parser - Find Span ID -



PHP Simple HTML DOM Parser - Find Span ID -

i trying confirm if particular

below illustration of html:

<div class="mgrrspninline"> <div class="header"> david, manager @ pub, responded review </div> <p class="partial_entry"> <span id="response_232376288"> give thanks taking time write review , post feedback. appreciate comments, hope go on visit , satisfied every time. looking forwards seeing 1 time again </span>

and below code using:

$ret = $html->getelementbytagname('span'); //print_r($ret); foreach($review_id $value){ if($ret->find($value)){ echo "yes"; } else { echo "no"; } }

$review_id list of review ids in array i.e - response_232376288 , want code @ point echo yes if finds response_232376288 , no if not, getting no's.

if can assist?

let's clean @ghost's reply bit. reply simple as:

echo $html->find('#response_232376288', 0) ? 'yes' : 'no';

there's no need clutter such simple reply bunch of baloney *(unless happen care baloney suppose)

php html simple-html-dom

No comments:

Post a Comment