Hi I am using laravel and I Have a array this array has keys that some of them are string I want to Change them to int and all of them going to be int
$nativeContent = NativeContent::find($id);
$nativeContentView = $nativeContent->countViewNative()
->orderBy('created_at', 'ASC')
->get()
->groupBy(function($date) {
return Carbon::parse($date->created_at)->format('m'); // grouping by months
});

"02" == 2is true, as its a weakly-typed language. You can treat strings-values of integers as integers if you really need to.$newArray = array_values($oldArray);$nativeContentView = array_values($nativeContentView);array_values($collection->toArray())