|
Posted by rich on 10/19/05 09:14
In article <43556f83$1@news.broadpark.no>, Siv Hansen says...
>
>I have this array,
>$navbar_left = array(
>'Hjem'=>'index.php',
>'Borte'=>'borte.php',
>'Uavgjort'=>'uavgjort.php'
>);
Maybe try this for starters to test if you're catching all the keys in your
array and their values...
foreach ($navbar_left as $key => $value)
{
echo "Key: $key Value: $value<br>\n";
}
Once you have that down you can replace the "echo" with whatever you needed to
do with the data.
Rich
--
Newsguy - http://newsguy.com
>
>I want to loop through it, but don't know how.
>I've tried
>foreach($navbar_left as $navbar){
> foreach($navbar as $key=>$value){
> // do something funny
> }
>}
>
>and
>foreach($navbar_left as $navbar){
> // do funny stuff
>}
>and
>foreach($navbar_left as $key=>$value){
> // do funny stuff
>}
>
>None working, keep getting Warning: Invalid argument supplied for
>foreach() in c:\wamp\www\cenit_web\index.php on line 14
>
>anyone?
Navigation:
[Reply to this message]
|