-1

I have a blackout, i have an array ($array) like this:

Array
(
    [Resume] => Array
        (
            [lang] => en
            [web] => http://
            [id] => Array
                (
                    [IdValue] => 222
                )
         )
)

how i can get only the value of [IdValue]

5
  • You need to tag the language. Commented May 21, 2018 at 1:34
  • By accessing it, not sure where you are stuck. Can you show the code you have right now? Commented May 21, 2018 at 1:40
  • i dont know how to accessing it Commented May 21, 2018 at 1:44
  • if key is fixed then $array['Resume']['id']['IdValue'] Commented May 21, 2018 at 1:56
  • Are you looking for something like this? stackoverflow.com/questions/3317856/php-get-key-from-array Commented May 21, 2018 at 1:58

1 Answer 1

1

You should look more into PHP arrays. But if I assume your example is in PHP then you can read it like this:

$myVar = Array // your array definition
// (
//  Resume] => Array
//     (
//         [lang] => en
//         [web] => http://
//         [id] => Array
//             (
//                 [IdValue] => 222
//             )
//      )
// )

echo $myVar['Resume']['id']['IdValue']; // prints 222
Sign up to request clarification or add additional context in comments.

2 Comments

i know now what i am doing bad. my array ist not an array, it is a string. is there an option to convert this string to array?
If string is JSON / Serialized array then yes using function like json_decode, unserialize. But output you have provided looks like print_r output and there is no standard function to turn it back to array unless you write your own.

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.