0
$vars = Array (
[name] => youname
[fields] => Array
        (
            [field_52aab3d95f535] => 400
            [field_52d5e94738a5a] => 
            [field_52aab3e65f536] => 
            [field_52aab3f85f537] => In Progress
            [field_52aab40e5f538] => 1
            [field_52aab3548adfc] => 
        )
)

Given this, how do I target "In Progress"? For the name, I can use $vars['name'], but I have trouble getting the values inside another array.

1
  • 2
    How about just $vars['fields']['field_52aab3f85f537'] Commented Feb 10, 2014 at 7:41

4 Answers 4

1

You simply do:

$vars['fields']['field_52aab3f85f537'];

In this way you access the value directly.

See also the docs: PHP arrays

Sign up to request clarification or add additional context in comments.

Comments

0

You access them as array's value - array. If that makes sense, not to me atm. HEHEHE

echo $vars['fieids']['field_52aab3d95f535'];

Comments

0

PHP array will help you to print the values of array inside another array.

foreach($vars['fields'] as $fields => $value){
    echo $array[$fields];
}

Comments

0

Try this echo $vars['fieids']['field_52aab3d95f535'];

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.