In my codeigniter application I have a form in my views and I want to pass the responses received from this form in json format for further use. Can anyone guide me on steps to do the same please
This code might help
$arr=['name'=>'Ankita','education'=>'Graduate'];
$json=json_encode($arr);
var_dump($json);
The result would be
string(40) "{"name":"Ankita","education":"Graduate"}"