Hi I have a doubt. Please help me if you know the answer Array ( [status] => Array ( [result] => Array ( [accts] => Array ( [0] => Array ( [domain] => abc.com [user] => abccom ) [1] => Array ( [domain] => cdf.com [user] => cdfcom ) ) ) ) ) PHP: This is an array $result I want to make a table like this Domain : User abc.com abccom cdf.com cdfcom This may be simple. But I am too confused with some other result and therefore my brain isn't working Anyone know the answer ? ..
Try the following code making the array data properly structured. $arr = Array ( [status] => Array ( [result] => Array ( [accts] => Array ( [0] => Array ( [domain] => abc.com [user] => abccom ) [1] => Array ( [domain] => cdf.com [user] => cdfcom ) ) ) ) ); foreach($arr[status][result][accts] as $k=>$v) { echo "Domain: ".$v[domain]."<br>"; echo "User:" .$v[user]; } PHP:
$ceva = Array('status' => Array('result' => Array('accts' => Array('0' => Array('domain' => 'abc.com','user' => 'abccom'),'1' => Array('domain' => 'cdf.com', 'user' => 'cdfcom'))))); $cv = $ceva['status']['result']['accts']; foreach ($cv as $cv) { print "Domain : $cv[domain] User $cv[user]"; } PHP: