I have the following tags and I want to extract buying and selling price: 2.9450 and 3.0150
<tr bgcolor="开发者_JAVA百科#E8EFF3">
<td width="25%" align="center" valign="middle" class="tx11">
USD</td>
<td width="8%" class="tx11">RON </td>
<td align="right" class="tx11">
**2.9450**</td>
<td width="8%" align="left" class="tx11"></td>
<td align="right" class="tx11">
**3.0150**</td>
<td width="8%" align="left" class="tx11"></td>
<td align="right" class="tx11">
**2.9249**</td>
</tr>
- can anyone help me with the pattern for the values please?
- how can I extract the values into variables? thank you
preg_match_all( '/\*\*(.+?)\*\*/s', $str, $matches );
$matches[1][0] and $matches[1][1] will contain the two number you want.
精彩评论