You are here: Re: Problem with multidimensional array « PHP Programming Language « IT news, forums, messages
Re: Problem with multidimensional array

Posted by Norman Peelman on 06/20/05 03:02

"Daniel Tryba" <partmapsswen@invalid.tryba.nl> wrote in message
news:42b3a2e9$0$13415$c5fe704e@news6.xs4all.nl...
> Norman Peelman <npeelman@cfl.rr.com> wrote:
> >> aparently the line " echo $name[nname].', '.$name[vname]."<br />";"
> >
> > Which is ugly in itself... try:
> >
> > echo "$name[nname], $name[vname]<br/>";
>
> Which is considered bad code:
>
http://www.php.net/manual/en/language.types.array.php#language.types.array.donts

Look alittle farther down the page under 'More examples to demonstrate
this fact:' and you will see:

// The following is okay as it's inside a string. Constants are not
// looked for within strings so no E_NOTICE error here
print "Hello $arr[fruit]"; // Hello apple

// With one exception, braces surrounding arrays within strings
// allows constants to be looked for
print "Hello {$arr[fruit]}"; // Hello carrot
print "Hello {$arr['fruit']}"; // Hello apple

--- end ---

Norman
---
FREE Avatar Hosting at www.easyavatar.com

 

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

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