Answer the question
In order to leave comments, you need to log in
How to get data from html code using php?
In general, there is such a page code:
<tr>
<td height="20"><a title="Замена кнопки Home" href="/V-iPhone-ne-rabotaet-knopka-Home">Замена кнопки HOME</a></td>
<td align="center"><span id="id169-iphone-5-home">1200</span></td>
<td align="center">от 30 минут</td>
<td align="center">3 месяца</td>
</tr>
<tr>
<td height="20"><a title="Ремонт кнопки блокировки" href="/Ne-rabotaet-knopka-vkliucheniia">Замена кнопки включения</a></td>
<td align="center"><span id="id166-iphone-5-power">1400</span></td>
<td align="center">от 30 минут</td>
<td align="center">3 месяца</td>
</tr>
Answer the question
In order to leave comments, you need to log in
$testStr = '<tr>
<td height="20"><a title="Замена кнопки Home" href="/V-iPhone-ne-rabotaet-knopka-Home">Замена кнопки HOME</a></td>
<td align="center"><span id="id169-iphone-5-home">1200</span></td>
<td align="center">от 30 минут</td>
<td align="center">3 месяца</td>
</tr>
<tr>
<td height="20"><a title="Ремонт кнопки блокировки" href="/Ne-rabotaet-knopka-vkliucheniia">Замена кнопки включения</a></td>
<td align="center"><span id="id166-iphone-5-power">1400</span></td>
<td align="center">от 30 минут</td>
<td align="center">3 месяца</td>
</tr>';
$regExpWrapper = "#<span(?:.*?)\"id(.*?)\-#si";
preg_match_all($regExpWrapper, $testStr, $matches);
print_r($matches);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question