You are here: Re: [PHP] Text between two tags « PHP « IT news, forums, messages
Re: [PHP] Text between two tags

Posted by "Richard Lynch" on 11/10/05 23:13

On Thu, November 10, 2005 8:56 am, Normmy2k wrote:
> Example
> I have this string :
> $text='<td></td>
> <td align="right" class="yfnc_tabledata3"></td>
> <td></td>
> <td align="right" class="yfnc_tabledata2"></td>
> <td></td>
> <td align="right" class="yfnc_tabledata1">1234</td>
> <td></td> <td></td> <td></td> <td align="right"
> class="yfnc_tabledata5"></td> ';
>
> And I want to retrieve the number 1234 between <td align="right"
> class="yfnc_tabledata1"> and </td>

If that string is consistently what you have, then this would also work:

$number = (int) trim(strip_tags($text));

This may prove more resilent to HTML changes from the source that is
generating all those table tags...

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this 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

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