title: PHP and Codeigniter. How to return an array object and not plain array?
body: <p>In Codeigniter I am creating an array and returning it to the user. I am creating the array like this (result is the return form a DB query):</p>
  
  <pre><code>array("email" =&gt; $result)
  </code></pre>
  
  <p>Right now it outputs:</p>
  
  <pre><code>"email": [
      {
          "id": "629",
          "desc": "0000",
          "value_1": "0000",
          "value_2": null,
          "value_3": null,
          "value_4": null,
          "privacy": "0"
      }
  ]
  </code></pre>
  
  <p>So <code>$result</code> is an array that contains a single object. How can I make <code>$result</code> contain just the object instead? Like this:</p>
  
  <pre><code>"email": {
      "id": "628",
      "desc": "THIS IS IT",
      "value_1": "THIS IS IT2",
      "value_2": null,
      "value_3": null,
      "value_4": null,
      "privacy": "0"
  }
  </code></pre>
  
  <p>Thankful for all input!</p>