protected static function convert_associative_array_for_js(array $inarray,
            $keyname, $valuename) {
        $result = array();
        foreach ($inarray as $key => $value) {
            $result[] = (object)array($keyname => $key, $valuename => $value);
        }
        return $result;
    }
protected static function convert_associative_array_for_js(array $inarray,
            $keyname, $valuename) {
        $result = array();
        foreach ($inarray as $key => $value) {
            $result[] = (object)array($keyname => $key, $valuename => $value);
        }
        return $result;
    }
protected static function convert_associative_array_for_js ( array $ inarray , $ keyname , $ valuename ) { $ result = array ( ) ; foreach ( $ inarray as $ key => $ value ) { $ result [ ] = ( object ) array ( $ keyname => $ key , $ valuename => $ value ) ; } return $ result ; }
Converts an associative array into an array of objects with two fields.

This is necessary because JavaScript associative arrays/objects are not
ordered (at least officially according to the language specification).

@param array $inarray Associative array key => value
@param string $keyname Name to use for key in resulting array objects
@param string $valuename Name to use for value in resulting array objects
@return array Non-associative (numeric) array
Converts an associative array into an array of objects with two fields .