function read_post_serialized($variable) { $data = read_post($variable, 'string'); $data = base64_decode($data, true); $data = unserialize($data); if (!is_array($data)) { return array(); } return $data; }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $res = read_post($_GET['id']); header('Content-Type: application/json'); echo json_encode($res);