You are here: Re: [PHP] Help taking a string from a file « PHP « IT news, forums, messages
Re: [PHP] Help taking a string from a file

Posted by Curt Zirzow on 10/04/00 11:37

On Sat, Jan 14, 2006 at 09:03:24AM -0700, Lists wrote:
>
> My goal is to take just the HTML for the image and link from the
> Flickr badge js script.
> ...
>
> <?
> // allow retrieval of external web source
> ini_set('allow_url_fopen',1);
>
> // get flickr js file
> $photo = file_get_contents("http://www.flickr.com/badge_code_v2.gne?
> count=1&display=latest&size=m&layout=h&source=user&user=91667218%
> 40N00");
>
> //get rid of all the crap except for the image tags
> ...

You're best aproach would be to look fo what you want. If all you
have to work with is some poorly written html doc and you want the
<a> <img> tag important parts?

preg_match('/<a href="([^"]+)".*?><img src="([^"]+)"/, $photo, $matches);
var_dump($matches);

Otherwise contact flicker and ask them for an API for what you are
trying to do. And if the above works dont expect it to work all the
time.

Curt.
--
cat .signature: No such file or directory
--
cat .signature: No such file or directory

 

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

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