Login   Register  
PHP Classes
elePHPant
Icontem

Getting problem in accessing simple xml object into an array

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      My Twitter  >  All threads  >  Getting problem in accessing simple xml object into an array  >  (Un) Subscribe thread alerts  
Subject:Getting problem in accessing simple xml object into an array
Summary:I am using function for getting user's followers.
Messages:1
Author:Rishi
Date:2010-05-26 07:35:39
 

  1. Getting problem in accessing simple xml object into an array   Reply   Report abuse  
Picture of Rishi
Rishi
2010-05-26 07:35:39
Hi,
I am using function to get users followers, but not able to access the simple xml object into an array. Getting user's other fields but when it comes to status field, which contain another array, doesnot get access to this array.
I have written code like this:
$data = $data = simplexml_load_string($xml);
foreach($data->users as $users)
{
foreach($users as $user)
{
foreach($user as $k=>$v)
{
$arr1[$k] = (string) $v;

}
}
$arr2[] = $arr1;
}

print_r($arr2);