Reputation: 5259
Well this is the html code:
<?
$html ='<table cellspacing="0" cellpadding="0" class="mytable">
<tr>
<th class="first-td">Home <span>Live</span></th>
<th>type</th>
<th>Status</th>
</tr>
<tr>
<td width="40%" class="first-td">text1</td>
<td>info</td>
<td class="status"><span class="identify">asdf2</span></td>
</tr>
<tr>
<td width="40%" class="first-td">text2</td>
<td>info</td>
<td class="status"><span class="identify2">asdf</span></td>
';
$pattern = '/<span class="identify">(.*?)<\/span>/im';
preg_match_all($pattern, $html, $matches);
print_r($matches);
?>
But what I want is to get back the word text, which is the td in that cell where class is identify. Or maybe if it is easier when class is identify print 1, or if it is identify2 press 0.
So I wna tin pseudocode like this:
If class-identify print the td-class=first-td of that cell
Upvotes: 0
Views: 132