1

I have this array

Zend_Db_Table_Row Object
(
    [_data:protected] => Array
        (
            [impressions] => 748043
            [clicks] => 20
            [revenue] => 49.546194
            [date] => 2014-04-30
        )

    [_cleanData:protected] => Array
        (
            [impressions] => 748043
            [clicks] => 20
            [revenue] => 49.546194
            [date] => 2014-04-30
        )

    [_modifiedFields:protected] => Array
        (
        )

    [_table:protected] => Application_Model_DbTable_Report Object
        (
            [_name:protected] => tbl_reporting
            [_definition:protected] => 
            [_definitionConfigName:protected] => 
            [_db:protected] => Zend_Db_Adapter_Pdo_Mysql Object
                (
                    [_pdoType:protected] => mysql
                    [_numericDataTypes:protected] => Array
                        (

For this I tried echo Zend_Json::encode((array)$data_m6);

but this gives me

{"\u0000*\u0000_data":{"impressions":"748043","clicks":"20","revenue":"49.546194","date":"2014-04-30"},"\u0000*\u0000_cleanData":{"impressions":"748043","clicks":"20","revenue":"49.546194","date":"2014-04-30"},"\u0000*\u0000_modifiedFields":[],"\u0000*\u0000_table":{},"\u0000*\u0000_connected":true,"\u0000*\u0000_readOnly":true,"\u0000*\u0000_tableClass":"Application_Model_DbTable_Report","\u0000*\u0000_primary":{"1":"entry_id"}}

I don't need \u0000*\u0000_... this all characters

1 Answer 1

1

Assuming that you only need the data stored in your instance of Zend_Db_Table_Row you can try this.

json_encode($object->toArray()); //Where object is your retrieved instance of Zend_Db_Table_Row.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.