如何通过给出密钥名称来获取密钥的特定值?

如何通过给出密钥名称来获取密钥的特定值?

问题描述:

Array
(
    [0] => stdClass Object
    (
        [domain] => alphaanalysis.org
        [status] => available
    )
}

I have the array and it's elements like this. I just need the value of domain key. How to get that, I don't know. Please help me.

  Array 
(
 [0] => stdClass Object 
(
 [domain]  ] => alphaanalysis.org 
 [status] =>可用
)
} 
  code>  pre> 
 
 

我有数组,它的元素是这样的。我 只需要域密钥的值。如何获得,我不知道。请帮助我。 p> div>

If your array is $x you can use:

$x[0]->domain

<?php
     $array[0]->domain; 
 ?>

If your array is $array then you can try this.

Just use this syntax for that

$arraynem[]->key;