Re: fopen

From: Date: Sat, 02 Mar 2002 23:53:42 +0000
Subject: Re: fopen
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-86932@lists.php.net to get a copy of this message
Craig, AFAIK you can't: fopen opens the file and leaves it up to you to read it a character or some other chunk at a time, keeping what you want, and leaving the rest. There is no concept of opening a file at a particular character position, other than to write-over or write-append. (see http://www.php.net/manual/en/function.fopen.php) Regards, =dn > How can I use fopen to retrieve just one html table out of a whole web page. > > I need to extract just this table (shown below) from this web page: > > http://quotes.nasdaq.com/quote.dll?page=multi&mode=stock&symbol=drooy > > Thanks Craig > *********************************************** > > <table border="0" cellspacing="0" cellpadding="0" > width="578"> > <tr> > <td nowrap > > <table border="0" cellspacing="0" cellpadding="0" > > <tr> > <td align="left" width="100" rowspan="2" > class="logoFont"> > <img > src="http://a676.g.akamaitech.net/f/676/838/1h/nasdaq.com/logos/DROO.GIF " > border="0" align="absmiddle" height="40">&nbsp; > </td> > <td nowrap><font face="Arial, Helvetica, Verdana" size="2"><b>Durban > Roodeport Deep, Ltd.</b>&nbsp;DROOY</font></td> > </tr> > <tr> > <td width="247" align="right"><font face="Arial, > Helvetica, Verdana" > size="2">Mar. 1, 2002&nbsp;Market Closed</font></td> > </tr> > </table> > </td> > </tr> > <tr> > <td nowrap> > <table border="0" cellpadding="0" cellspacing="0"> > <tr> > <td nowrap width="85">Last Sale:</td> > <td align="right" width="85"><nobr><b>$&nbsp;2.76</b></nobr></td> > <td > width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> > <td align="left" nowrap width="100">Net Change:</td> > <td align="right"><nobr><b>&nbsp;<font color=".FF0000">0.02</font><img > src="http://a676.g.akamaitech.net/7/676/838/b801fe1d2351e8/nasdaq.com/im ages > /nc_down.gif" border="0" width="11" > > height="10"></b></nobr>&nbsp;<nobr><b>&nbsp;<font > color="FF0000">0.72%</font></b> </nobr></td> > <td > width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> > <td rowspan="5" valign="top" align="left" nowrap> > <font face="Arial, Helvetica, Verdana" size="1"> > <a > href="http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selec ted= > DROOY%60&content=http://www.drd.co.za"><img > src="http://a676.g.akamaitech.net/f/676/838/1d/nasdaq.com/images/new_web link > s.gif" border="0"></a>&nbsp;&nbsp;<a > href="http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selec ted= > DROOY%60&content=http://www.drd.co.za" > class="clsA">Web Site</a><br> > </font> > </td> > </tr> > <tr> > <td nowrap width="85">Today's High:</td> > <td > align="right"><nobr><b>$&nbsp;2.80</b></nobr></td> > <td width="20">&nbsp;</td> > <td nowrap width="100">Today's Low:</td> > <td align="right" nowrap > ><nobr><b>$&nbsp;2.64</b></nobr></td> > </tr> > <tr> > <td nowrap width="85">Best Bid:</td> > <td align="right" width="85"><nobr><b>$&nbsp;2.75</b></nobr></td> > <td width="20">&nbsp;</td> > <td nowrap width="100">Best Ask:</td> > <td align="right" > nowrap><nobr><b>$&nbsp;2.76</b></nobr></td> > </tr> > <tr> > <td nowrap width="85">Volume:</td> > <td align="right" > width="85"><b>1,551,300</b></td> > <td width="20">&nbsp;</td> > <td nowrap width="100">Previous Close:</td> > <td align="right" > nowrap><nobr><b>$&nbsp;2.78</b></nobr></td> > </tr> > <tr> > <td nowrap valign="top" width="85">Market:</td> > <td nowrap align="right" valign="top" > width="85">Nasdaq-SCM</td> > <td width="20">&nbsp;</td> > <td nowrap width="200" align="left" valign="top" > colspan="2"><b>American Depositary Shares</b></td> > </tr> > </table> > > >

« previous php.general (#86932) next »