Re: array problems
| From: | Jason Wong | Date: | Fri, 28 Nov 2003 08:15:13 +0000 |
| Subject: | Re: array problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171249@lists.php.net to get a copy of this message | ||
On Friday 28 November 2003 16:03, SLanger@spirit21.de wrote:
> I think what you got is a scope problem. You are creating $content_array
> in your while loop so its scope is limited to the while loop. To test this
> simply do a var_dump or print_r on $content_array outside your loop and
> see if it actually is an array, which I guess it won't it will either be
> null or an empty string.
>
> To solve simply do an initialisation of the variable before the while loop
> like $content_array = ''.
So that people don't get misled, the above is completely wrong. WHILE loops do
not have their own scope.
The correct answer (or the most plausible) was given in an earlier response by
Marek, which pointed out that the last line(s) of the file may have just
contained a CR and/or LF.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Marriage is the waste-paper basket of the emotions.
*/