I have an assiciative multidenentional array,
what I am tring to do is to receive a value by key name.
for example, when I will write $call['NAME'] I will get the key value
this is may array:
Array
(
[0] => stdClass Object
(
[ID] => 15678996
[START] => 2016-10-07 10:33:08
[END] => 2016-10-07 10:39:16
[NAME] => פרי גנך
[CALLERID] => 0504446349
[CALLEE] => 089975757
[O_EXTEN] => 1
[EXTEN] => 1
[SUPERID] => 49256
[CUSTID] => 320748
[PRICE] => 0.0
[ANS_TIME] => 2016-10-07 10:33:09
[DISPOSITION] => ANSWER
[DURATION] => 367
[INCOME] => 0.00
[PR_NUMBER] => 723924039
[CONCATENATION] => 320748,ANSWER;
[OUTERID] =>
)
[1] => stdClass Object
(
[ID] => 15677268
[START] => 2016-10-07 08:53:47
[END] => 2016-10-07 08:54:21
[NAME] => פרי גנך
[CALLERID] => 0544300515
[CALLEE] => 089975757
[O_EXTEN] => 1
[EXTEN] => 1
[SUPERID] => 49256
[CUSTID] => 320748
[PRICE] => 0.0
[ANS_TIME] => 2016-10-07 08:53:48
[DISPOSITION] => ANSWER
[DURATION] => 33
[INCOME] => 0.00
[PR_NUMBER] => 723924039
[CONCATENATION] => 320748,ANSWER;
[OUTERID] =>
)
)
What i want to achieve is to echo each value by writing his key name.
the main array is called $all_calls
this is what i havee done so far:
foreach($all_calls as $call ){
foreach ($call as $key => $value){
echo '<b>Key</b> '.$key .': <b>Value</b> '. $value;
}
}
what am i missing here?
stdClass objectsare objectsstdClassobject can be used in aforeachloop..