Hello friends.
In my database I have table named “groups” and inside this table, among the others, I have column named “permissions” with a value {“admin”: 1}. Now, in my PHP code, when I use json_decode function, nothing happens, function doesn’t work and it won’t print anything. This is my code:
[php]
$group = $this->_db->get(‘groups’, array(‘id’, ‘=’, $this->data()->protyp));
$permissions = json_decode($group->first()->permissions, true);
print_r($permissions);
[/php]
When I echo $permissions = $group->first()->permissions; (without json_decode), everything works, but when I use json_decode, nothing happens. I use PHP 5.6. Can anyone help me? Thanks in advance