Reply to Re: finding a specific area from page using regular expression

Your name:

Reply:


Posted by Kurt Milligan on 08/06/07 02:21

On Aug 4, 12:23 pm, Hardik Dangar <hardikdan...@gmail.com> wrote:
[snip]
>
> now from that table i want name,address,phone no,email,website..
> using preg_replace function i was able to find all those things but it
> removes <A> tag so email and website are also removed...can anyone
> tell me how i can find email and website first from that code and then
> using preg_replace i can get other records...or else can anyone tell
> me any better solution like currently by using while loop and using if
> condition i m breaking at the main table and then fetching each record
> but any better solution ?

This should do what you want (retrieving the email and URL):

$matches = array();

preg_match('/<a href=[\'"]?mailto:([^>\'"\s]+).*<a href=[\'"]?([^>
\'"\s]+)/s',$yourPageContents,$matches);

print "email: $matches[1], url: $matches[2]";

HTH
-Kurt

[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

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