Re: Re: Code errors
| From: | Marek Kilimajer | Date: | Thu, 18 Jul 2002 15:06:58 +0000 |
| Subject: | Re: Re: Code errors | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108270@lists.php.net to get a copy of this message | ||
My guess is that there is no ',' in $Line, so split returns an array with one variable, so list() warns you
parameter No. 1, 2 ,3 4 and 5 are not asigned any value.
Chris Crane wrote:
247: list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) = split(",", $Line); "Scott Fletcher" <scott@abcoa.com> wrote in message news:20020718143046.60104.qmail@pb1.pair.com...Which line in the script you had provided to us is line 247? "Chris Crane" <ccrane@inxdesign.com> wrote in message news:20020718141429.52411.qmail@pb1.pair.com...anythingI am trying some code and it works except I get the following errors... Warning: Undefined offset: 5 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 4 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 3 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 2 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Warning: Undefined offset: 1 in c:\www\htdocs\demos\havasuinternet\havasuinternet-lib.php on line 247 Here is the code, could someone tell me what's wrong. I don't see"http://table.finance.yahoo.com/table.csv?a=7&b=1&c=2002&d=7&e=17&f=2002&s=$wrong... function HistoricalStock($sym) { $LookupURL =<td>$H_Date</td>\n<td>$H_Open</td>\n<td>$H_High</td>\n<td>$H_Low</td>\n<td>$sym&y=0&g=d&ignore=.csv"; $Results = implode('', file("$LookupURL")); $Data = explode("\n", $Results); print '<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#6699cc"><tr bgcolor="#FFFFFF">'; foreach($Data as $Line) { list($H_Date, $H_Open, $H_High, $H_Low, $H_Close, $H_Volume) =split(",",$Line); print "<tr bgcolor=\"#FFFFFF\">H_Close</td>\n<td>$H_Volume</td>\n</tr>"; } print '</table>'; }