1

How to access this value from array [value] => 11113610 ?

 Array
 (
 [is_saml] => Magento\Framework\Api\AttributeValue Object
    (
        [_data:protected] => Array
            (
                [attribute_code] => is_saml
                [value] => 1
            )

    )

[uwid] => Magento\Framework\Api\AttributeValue Object
    (
        [_data:protected] => Array
            (
                [attribute_code] => uwid
                [value] => rs-build
            )

    )

[student_number] => Magento\Framework\Api\AttributeValue Object
    (
        [_data:protected] => Array
            (
                [attribute_code] => student_number
                [value] => 11113610
            )

    )

)
0

Assuming you are getting the array data in $response variable.
You can get it by decoding first the response:

$data = json_decode($response, true);   

And then echo or save it to a variable like this:

echo $data['student_number']['_data:protected']['value'];  

And for getting all of it in a response, use foreach loop:

foreach($data as $key => $item){
   echo $item['_data:protected']['value'].'<br>';
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.