Reply to Need help getting text between tags

Your name:

Reply:


Posted by Baquanb on 04/26/06 00:08

I need to get some text between font tags but I only need the text in
the last table. The code i'm using below will get text between all font
tags anyone know how I can just get whats in TABLE3 font tags.

$url = "http://www.mysite.com";
$data = implode("", file($url));
preg_match_all ("/<td>([^`]*?)<\/td>/", $data, $matches);

foreach ($matches[0] as $match) {

preg_match ("/<font>([^`]*?)&nbsp;<\/font>/", $match, $temp);
$text = $temp['1'];
$text= strip_tags($text);

echo $text;

}

TABLE1
<table>
<td>
<font>text1</font>
<b>something</b>
</td>
<td>
<font>text2</font>
<b>something</b>
</td>
<td>
<font>text3</font>
<b>something</b>
</td>
</table>

TABLE2
<table>
<td>
<font>text4</font>
<b>something</b>
</td>
<td>
<font>text5</font>
<b>something</b>
</td>
<td>
<font>text6</font>
<b>something</b>
</td>
</table>

TABLE3
<table>
<td>
<font>text7</font>
<b>something</b>
</td>
<td>
<font>text8</font>
<b>something</b>
</td>
<td>
<font>text9</font>
<b>something</b>
</td>
<td>
<font>text10</font>
<b>something</b>
</td>
</table>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация