converting array into appropriate json format in yii1
<p>I am using yii1. I have following code which converts array into json:</p>

<pre><code>public function actionIndex()
    {
/*      $this-&gt;layout='//layouts/datatable';*/
        if(Yii::app()-&gt;request-&gt;isAjaxRequest) {
            $model = Company::model()-&gt;findAll();
            $data = array_map(function ($model) {
                return $model-&gt;attributes;
            }, $model);
            $responce = json_encode($data);
            var_dump($responce);
            return $responce;
        }
        else {
            return $this-&gt;render('list');
        }
    }
</code></pre>

<p>It returns json data <code>string(1221) "[{"c_id":"1","c_name":"Marokand", ...</code>
However, i need json data with the following format:</p>

<pre><code>[{c_id: 1, c_name: "Marokand",
</code></pre>

<p>Please, help me.</p>