I have this problem.
I used this sentence to get post info in CodeIgniter 1.7.2 and it works fine
function function1(){
$input_data = json_decode(trim(file_get_contents('php://input')), true);
$info = str_replace( '"', '', json_encode($input_data['info']));
}
My input json is this:
{
"info":"hello!"
}
But when I used these same lines in CodeIgniter 2.1.3 it doesn't work. I used echo $info
but my answer is null
. Anyone can help me? Where is the mistake?