I got an array as follows.
I need to convert the values as integer
array:17 [
0 => array:2 [
"c" => "gmail"
"co" => "12"
]
1 => array:2 [
"c" => "dddd"
"co" => "2"
]
2 => array:2 [
"c" => "mmmmm"
"co" => "2"
]
3 => array:2 [
"c" => "dsf"
"co" => "2"
]
4 => array:2 [
"c" => "aaaa"
"co" => "1"
]
5 => array:2 [
"c" => "bbbb"
"co" => "1"
]
6 => array:2 [
"c" => "ccc"
"co" => "1"
]
7 => array:2 [
"c" => "yopmail"
"co" => "1"
]
8 => array:2 [
"c" => "yahoo"
"co" => "1"
]
]
I need to convert all values of the key co to integer ,where currently they are string.
Is this is the way to use the foreach,which didn't give me correct output
foreach($getDashboardDetails as $getDashboardDetails)
{
$getDashboardDetails['co']=(int)$getDashboardDetails['co'];
}
Hope Someone can help
foreach?