Hi guys I need a bit of help here,
My variable $a has value [{"id":"[1, 2, 3]"}] of type object, now from this I want the first id i.e. in this case I want 1. How can I fetch ut from variable $a?
When I var_dump it prints as below
class Illuminate\Support\Collection#1230 (1) {
protected $items =>
array(1) {
[0] =>
class stdClass#1221 (1) {
public $a =>
string(9) "[1, 2, 3]"
}
}
}
Thank you.
($a[0])->id[1]