You are here: Re: fread usage « PHP Programming Language « IT news, forums, messages
Re: fread usage

Posted by Jerry Stuckle on 05/04/06 20:29

vito wrote:
> after reading your comments,
>
> i made some changes.
>
> 1)switch to use "acd" instead of "big problem"
> 2)try use file_get_contents instead
>
>
> $theFile ="http://images.google.com/images?q=acd";
>
>
> the $content contains:
>
> <img
> src=/images?q=tbn:8w7TF3ADocTy3M:cheminf.cmbi.ru.nl/cheminf/isis/pict/acd_price.gif
> width=134 height=105>
>
> but i just don't know why
>
> $matchno = preg_match_all("/.*<img src=/images?q=tbn:.*:(.*) width=.*>.*/",
> $content, $regs);
>
> returns nothing. ($matchno echo nothing)
>
> furthermore, how is Jerry able to count the size? could anybody tell me?
> indeed, i need not retrieve the whole content but just a single little image
> is grateful.
>
>
>

Vito,

I was looking at your fread() call - you say get up to 9*1024*1024 bytes - which
is 9 mb.

And you are getting the correct information back. When you fetch a page
containing images, the webserver returns <img> tags. The browser must then go
out and fetch each of those images.

Open the page with your query and then look at the HTML source. This is what
your program should be getting. Writing that to the user's browser should cause
the browser to initiate further connections to retrieve the data.

As for your regex - ? is a control character (makes the preceding character
optional). You need to escape it, i.e.

... images\?q=tbn ...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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