I have an array like:
Array
(
[746] => 3
[208] => 2
[1091] => 1
[313] => 1
[305] => 1
[707] => 1
)
I’d like to create an array like:
Array (
[0] => 746
[1] => 208
[2] => 1091
[3] => 313
[4] => 305
[5] => 707 )
I’m pretty sure I could do it with a foreach loop, but was wondering if there was an easier method available?
Very easy with array_keys
One advantage of use this built-in function instead of foreach is the power of C code compiled. So PHP native functions are, in general, more fast