0

I already have data in array as

 $a = array (
     [2011-07-09] => array(['new'] => 12),
     [2011-07-10] => array(['new'] => 15)
 );

Now I want to add another key-value pair to inner array so that output will be like

 $a = array (
     [2011-07-09] => array(['new'] => 12, ['recurring'] => 52),
     [2011-07-10] => array(['new'] => 15, ['recurring'] => 80)
 );

How can I do this?

2 Answers 2

1
$a['2011-07-09']['recurring'] = 52;
$a['2011-07-10']['recurring'] = 80;
Sign up to request clarification or add additional context in comments.

Comments

1

Depending on how you plan to implement the recurring key, this will do:

$a['2011-07-09']['recurring'] = 52;
$a['2011-07-10']['recurring'] = 80;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.