RE: [PHP] Re: array block

2004-01-31 Thread Shawn McKenzie
'href' => 'foo', 'title' => 'bar', 'style' => 'amet' ) ); foreach ($menu as $array) { $tag = " $v) { $tag .= " $k=\"$v\"&

Re: [PHP] Re: array block

2004-01-31 Thread Brian V Bonini
On Fri, 2004-01-30 at 22:48, Shawn McKenzie wrote: > You would need to give an example of what you mean by change dynamically, > because if you can't predict the key indexes then how can you know which > ones to use in your anchor tag? say this: $menu = array ( 'link1' => array(

Re: [PHP] Re: array block

2004-01-31 Thread Jason Wong
On Saturday 31 January 2004 11:48, Shawn McKenzie wrote: > You would need to give an example of what you mean by change dynamically, > because if you can't predict the key indexes then how can you know which > ones to use in your anchor tag? foreach ($arr as $key => $value) { echo "Key: $k

Re: [PHP] Re: array block

2004-01-30 Thread Shawn McKenzie
You would need to give an example of what you mean by change dynamically, because if you can't predict the key indexes then how can you know which ones to use in your anchor tag? -Shawn "Brian V Bonini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -- PHP General Mailing List (htt

Re: [PHP] Re: array block

2004-01-30 Thread Brian V Bonini
On Fri, 2004-01-30 at 18:47, Shawn McKenzie wrote: > Sorry, $k should be $text. > > foreach ($menu as $text => $array) { > $url = $array['url']; > $title = $array['title']; > > echo "$text\n"; > } > Gotcha, thanks! That'll work for this but for arguments sake what if the inner array were to

[PHP] Re: array block

2004-01-30 Thread Shawn McKenzie
Sorry, $k should be $text. foreach ($menu as $text => $array) { $url = $array['url']; $title = $array['title']; echo "$text\n"; } "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > foreach ($menu as $text => $array) { > $url = $array['url']; > $title = $array['ti

[PHP] Re: array block

2004-01-30 Thread Shawn McKenzie
foreach ($menu as $text => $array) { $url = $array['url']; $title = $array['title']; echo "$k\n"; } HTH -Shawn "Brian V Bonini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm having array block, trying to format the data in a two dimensional > associative array. > > $menu =

[PHP] Re: array block

2004-01-30 Thread John Schulz
Brian V Bonini wrote: I'm having array block, trying to format the data in a two dimensional associative array. foreach($menu as $k => $v) { etc.. need to end up with link(x) Since it's two-dimensional, the $v you're getting is actually an array. So you'll have to iterate through the outer arra