Jump to content

[SOLVED] Add Value + Key to an array


PatPHP

Recommended Posts

Hi

 

I reckon it is very simple but I didn't find any solution yet.

 

How can I add more values with key to an array?

 

$aReturn = array();

$aReturn[] = array($aRow['id'] => $aRow['Type']);

 

This adds arrays but then I have arrays in an array.

 

Array should look like this:

$aReturn[] = array("mist1" => "111", "mist2" => "222", "mist3" => "333");

 

Now how can I add more value to this array? Please "Value" + "Key".

 

Thx

Link to comment
https://forums.phpfreaks.com/topic/113171-solved-add-value-key-to-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.