unserialize() value of database and putting it in json_encode after foreach
问题 I insert in database values (array) $row->units with use function serialize() => [$row->units] , how can echo they with unserialize() in json_encode with $row->name ? (return send for ajax call in jQuery) Columns in database: $row->units => a:6:{i:0;s:15:"Coffee";i:1;s:14:"Satellite";i:2;s:11:"Game Notes";i:3;s:14:"Internet";i:4;s:10:"Pool";i:5;s:0:"";} $row->name=> George Kurdahi $query = $this->db->query("SELECT * FROM arraha WHERE name LIKE '%$search%' ORDER BY name asc"); $data = array();