You are here: Re: [PHP] Problem with foreatch() « PHP « IT news, forums, messages
Re: [PHP] Problem with foreatch()

Posted by James Kaufman on 01/16/05 18:07

On Sun, Jan 16, 2005 at 03:20:26PM +0000, Ben Edwards (lists) wrote:
> I have the following Code:
>
> foreatch( $_POST["mtype"] as $akey => $avalue ) {
> echo "$akey, $avalue<br>";
> }
>
> When I run it I get:
>
> Parse error: parse error, unexpected T_AS
> in /var/www/mb/mb_estab_update.php on line 58
>
> 58 is the line with the foreatch on it. However if I replace it with:
>
> print_r( $_POST["mtype"] );
>
> I get:
>
> Array ( [1] => RESTAURANT [2] => BEVERAGEWINE [3] => MAIN )
>
> so the array is populated, what am I doing Wrong?
>
> Regards,
> Ben

You could try:

foreach( $_POST["mtype"] as $akey => $avalue ) {
echo "$akey, $avalue<br>";
}

 

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

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