tags:

views:

578

answers:

3

How can i return my output in ArrayCollection?

values = array();
     while($row = mysql_fetch_array($result)) 
     {
      $values[] = array(mysql_num_rows($result),$row['userlevel'],$row['email'],$row['member_id']);
     }
     return $values;

I need the output as ArrayCollection

+2  A: 

PHP has no such thing as an ArrayCollection as far as I'm aware.

From a quick Google search it seem like this is more about ActionScript/Flex. This page has some examples of how to get an ArrayCollection from a PHP array. Not sure if it's what you're looking for though.

Rich Adams
+1  A: 

See this:

http://groups.google.com/group/flex_india/browse_thread/thread/f7af9f284216732e

I'm guessing you're talking about a FLEX ArrayCollection.

karim79
+1  A: 

If what others are saying is true, and you're referring to implementation of ActionScript's ArrayCollection in PHP, then from that example I conclude you're talking about what everyone else calls associative arrays or dictionaries. If that is so, I'll be happy to tell you that array object, as returned by PHP's array() function, already incorporates all you need.

If you would be so kind to clarify what exactly you mean by ArrayCollection, we might be able to help you better (and earn our up-points) :-)

Ivan Vučica