1

I am operating with array that looks like this:

$pms = array(
    'msg1' => array(
        'status' => 'unread',
        'subject' => 'bla bla'
    ),
    'msg2' => array(
        'status' => 'unread',
        'subject' => 'test..'
    ),
    'msg3' => array(
        'status' => 'unread',
        'subject' => 'moreee..'
    )
);

What I want to achieve is to be able to select 'msg3' for example, update the status from 'unread' to 'read' and put it back in its position in the array.

How to do that?

1
  • 3
    $pms['msg3']['status'] = 'read'; Commented Jul 9, 2012 at 18:40

1 Answer 1

5

Just assign the new value to it like any other array variable:

$pms['msg3']['status'] = 'read';
Sign up to request clarification or add additional context in comments.

1 Comment

Pretty impressive how fast you were able to extract what he wanted

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.