I have an array like this:-
$str = array(
array(
'amount' => 1.87,
'user' => 'hello',
),
array(
'amount' => 0.9,
'user' => 'test' ,
),
array(
'amount' => 9,
'user' => 'hello',
),
array(
'amount' => 1.4,
'user' => 'test1',
)
);
Now I want to show the both the amounts in an html table which user 'hello' has. I tried the following for searching it :-
$ac = array_search("hello", $str);
echo $str["$ac"];
But it doesnt work. Is there anyway to show an result like this for user 'hello' :-
1.87
9
So that I can later show in html table.