Jump to content

[SOLVED] making a key in an array


M.O.S. Studios

Recommended Posts

hey guys,

I want to make the key of a array the path of a file, and the value the name of the file.

how ever i cant seem to figure this out, any one have any ideas?

 

here is my code:


$menus=scandir("common/menu");
for($m=0; $m<=count($menus); $m++)
{
if($menus[$m]!="." && $menus[$m]!=".." && $menus[$m])
{
 $key="common/menu/".$menus[$m];
 $menu_include[$key]=$menus[$m];
}
}

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/156292-solved-making-a-key-in-an-array/
Share on other sites

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.