Re: fread usage
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Thu, 04 May 2006 13:29:02 -0400
after reading your comments,
i made some changes.
1)switch to use "acd" instead of "big problem"
2)try use file_get_contents instead
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.
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
JDS Computer Training Corp.
- Prev by Date: PHP instances writing to the same file?
- Next by Date: Re: Who is using PHP today?
- Previous by thread: Re: fread usage
- Next by thread: accessing static member if class name is a variable (crosspost php.general)