'href' => 'foo',
'title' => 'bar',
'style' => 'amet'
)
);
foreach ($menu as $array) {
$tag = " $v) {
$tag .= " $k=\"$v\"&
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(
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
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
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
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
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 =
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
8 matches
Mail list logo