Add New Key to Array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Add New Key to Array

Post by tecktalkcm0391 »

Is this possible to do, someway, cause I can't get it to work!

Code: Select all

$output = array();
$output['thisNewKey'] = 'thisNewValue';
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Add New Key to Array

Post by califdon »

That works for me. Are you saying that you get an error, or you assign the value but can't read it out?
Post Reply