title: code igniter php - unserialize an array
body: <p>I have previously serialized an array in PHP and submitted it to a database. Now, in my model in Code Igniter, I want to unserialize that data but I'm not sure how to reference it. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>function get_selected_member($member = null){
      if($member != NULL){
          $this-&gt;db-&gt;where('id', $member); //conditions
      }
      $query = $this-&gt;db-&gt;get('members'); //db name
  
      if($query-&gt;result()){
          $member_result = $query-&gt;row();
          //log_message('info', $member_result[$member_result-&gt;member_dep]); //trying to find member_dep - how do I reference it?
  
          return $member_result;
      }
  }
  </code></pre>
  
  <p>So member_result is an object containing all of values for the table row matching the member a user selected from a form. Within this object, one of the column values is member_dep - but referencing it as $member_result[$member_result->member_dep] does not work. How do I refer to this. I basically want to pull that value out, declare it as a variable, call unserialize(), and then put it back into place so that it can be read by JQuery / HTML as an array.</p>