I am working in yii framework.I am having json input as-
$json='{"userId":1,"questionPaperId":1;"optionId":2}';
So whilw creating functions in yii,i am decoding it and accessing these inputs as-
$obj=CJSON::decode($json);
$option=$obj->optionId;
$userId=$obj->userId;
$paperId=$obj->questionPaperId;
But its giving error as “Trying to get property of non-object “. So how to access this in yii?
You json string is syntax wrong.
should be