Jump to content

add to an array ELEMENT


alecks

Recommended Posts

Not adding an element to an array, but adding a string to an element in an array

 

ex.

$array = array('x' => 'jorge');

 

and I would like for "joe" to be added to the "x" element of array $array, so that (at the end of the script) the array will look like this:

 

print_r($array);

/* 
Should output something like

Array{[x] => jorgejoe}
*/

 

Is there any way to do this, or will I have to work around it?

Link to comment
https://forums.phpfreaks.com/topic/38837-add-to-an-array-element/
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.