You are here: Re: Arrays on the fly « PHP Language « IT news, forums, messages
Re: Arrays on the fly

Posted by Brian on 03/28/07 15:21

>>Below is the full code, I get an error saying
>>"Fatal error: Cannot use [] for reading in /var/www/...."
>>on this line, it will not add to the array?
>>
>>$$k[] = $file; // add file to array

Geoff Wrote

> Variable variables doesn't work with arrays like this. I solved it by
> using a multi dimensional array but some people posted some alternatives
> on one of the groups recently. (solutions involved curly brackets I
> think)

Hi Geoff

Thanks for the replay, yes curly brackets did
work, the line was changed to

${$k}[] = $file;


Many thanks

Brain






--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 1505 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!

 

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

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