T
T
Timur Khudiyev2018-03-15 13:18:47
PHP
Timur Khudiyev, 2018-03-15 13:18:47

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

2 answer(s)
U
unknown, 2018-03-15
@NikkyNick1

[ 0 => 'a', 1 => 'b', 2 => 'c'] this is ['a', 'b', 'c']. Simply in the first case you explicitly specify indexes.

I
Ildar Saribzhanov, 2018-03-15
@Bluz

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 question

Ask a Question

731 491 924 answers to any question