I have following code:
public function actionsdf($id){
$dsf=UserLog::model()->findByPk($id);
$decode=$dsf->text;
var_dump($decode=$dsf->text);
$res=CJSON::decode($decode);
var_dump($res);
}
The result of var_dump($decode=$dsf->text);
is
string(103) "{"text":"LOG_EVENT_MEMBERSHIP_FORM_SENT {time}{form_id}","params":{"{time}":"11:38","{form_id}":"402"}}"
and the result of decoded json(var_dump($res);)
is
array(2) { ["text"]=> string(46) "LOG_EVENT_MEMBERSHIP_FORM_SENT {time}{form_id}" ["params"]=> array(2) { ["{time}"]=> string(5) "11:38" ["{form_id}"]=> string(3) "402" } }
I need to retrieve only 402
itself from form_d(where form_id=402). How can I do it?