Answer the question
In order to leave comments, you need to log in
How to convert an associative array to a normal one?
Good day.
The point is this. There is an associative array of the form:
Can it be somehow converted into this form: ?
I found some kind of stupor, or I don’t understand something)
Thank you all. $arr = [ 0 => 'a', 1 => 'b', 2 => 'c']
['a', 'b', 'c']
Answer the question
In order to leave comments, you need to log in
[ 0 => 'a', 1 => 'b', 2 => 'c'] this is ['a', 'b', 'c']. Simply in the first case you explicitly specify indexes.
In general, the comment was correct, you wrote equivalent arrays, provided that in the first case it is numeric keys. not strings.
In all other cases it will help: array_values()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question