Question

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

Was it helpful?

Solution

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.

OTHER TIPS

ArrayCollection is part of Collections, a Doctrine project.

There is no published documentation but the available methods can be seen in the ArrayCollection class itself.

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) :-)

See this:

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

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

ArrayObject class in php (spl) comes close to idea of ArrayCollection in as3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top