i am new to php so sorry if this question is dumb
Thats the array I have
array(1) { [0]=> array(1) { ["count"]=> int(4) } }
and i just need to save the 4 in a new variable named 'number'
CodePudding user response:
The first subscript [0] gets you the first element of the array, the ['count'] gets you the 4 from within the first element.
$count = $arr[0]['count'];
CodePudding user response:
Its quite simple
$number = $array[0]["count"]
or do you want to loop through and find all integers in case of a larger array?