I want to array_diff()
two arrays in Laravel. The first array looks like this:
array:4 [
0 => 7248
1 => 7249
2 => 7250
3 => 7251
]
the second one:
array:4 [
0 => "7248"
1 => "7249"
2 => "7250"
3 => "7251"
]
this one I get with $request->request->get('ids', []);
.
How can I convert one array to either strings or integers? As these arrays can grow large, I don't really want to convert every single value one at a time.
Update:
array_diff() is doing it's job, altough there are strings vs. integers.
Thanks in advance!
This code will convert your string fields to int so you can compare.