i have in my row an array when i go this result
{"type":"person1","id":"12"}
I want just to get the id as result value 12
i have in my row an array when i go this result
{"type":"person1","id":"12"}
I want just to get the id as result value 12
$addedBy = json_decode($row['added_by']);
$id = $addedBy['id'];
Use json_decode:
$value = ' {"type":"person1","id":"12"}';
$result = json_decode($value, true);
echo $result['id']; // 12