Jump to content

[SOLVED] ForEach-Name of current item of associative array


Scripts

Recommended Posts

new to php. working on my first php script..

 

this:

$arr=array("xxx"=>"fff","yyy"=>"ggg");

foreach($arr as $value)

echo $value;

 

echos fffggg

 

but i want the names(xxx,yyy) too. something like this:

 

$arr=array("xxx"=>"fff","yyy"=>"ggg");

foreach($arr as $value)

echo $value_name . $value;

 

how? ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.